My site is going to be switching servers soon because my cPanel isn't working well. I'm trying to set it up so that all files/folders/anything on my site redirects to a file. That part I have working, the only problem is, I can't get it to stop redirecting if that's the file called. How do I do this?
you'd be better off doing this:
DirectoryIndex index.html index.php
and putting
<script type="text/javascript">location.href=whatever the url is</script>
in every file except the one you're redirecting to.
(2009-07-24, 09:18 PM)StingReay Wrote: [ -> ]you'd be better off doing this:
DirectoryIndex index.html index.php
and putting <script type="text/javascript">location.href=whatever the url is</script>
in every file except the one you're redirecting to.
I don't want to go through 1000s of files just to have it redirect to one, then when the sites moved, I don't want to have to go through 1000s of files removing that.
Use this:
RewriteEngine On
RewriteBase /
RewriteCond %{REMOTE_HOST}
RewriteRule .* http://www.newdomain.com [R=301,L]
Never mind. My site's been moved... I think. Thanks anyways.
Could a moderator close this please?
(2009-07-24, 09:18 PM)StingReay Wrote: [ -> ]you'd be better off doing this:
DirectoryIndex index.html index.php
and putting <script type="text/javascript">location.href=whatever the url is</script>
in every file except the one you're redirecting to.
And if somebody has deactivated JS you have had it...
No good idea
HTACCESS is the better solution.
(2009-07-26, 06:31 PM)Lennart Sauter Wrote: [ -> ] (2009-07-24, 09:18 PM)StingReay Wrote: [ -> ]you'd be better off doing this:
DirectoryIndex index.html index.php
and putting <script type="text/javascript">location.href=whatever the url is</script>
in every file except the one you're redirecting to.
And if somebody has deactivated JS you have had it...
No good idea
HTACCESS is the better solution.
Also, I don't want to edit 1000s of files. That would just take TOOO damn long. Htaccess is 1 file in a directory.