Forum Moderators: phranque

Message Too Old, No Replies

does a domain name affect htaccess?

         

omoutop

8:21 am on Feb 15, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hi all and thanks in advance.

I am moving sites from server1 to server2 - when all sites are moved, i will point domain names to server2.
Untill then i test the sites using
#*$!.xxx.xxx.xxx/~username instead of domain name.

In a couple of those sites i use htaccess, which refuce to work at all.

Could it be the lack of proper domain name?

jdMorgan

2:14 pm on Feb 15, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> "refuses to work at all"

No, its more likely that there is a server config problem, or that mod_rewrite is not supported on the new server.

Unless either of those are true, then mod_rewrite should still work, with the possible exception that your hard-coded external redirects would still go to the old server.

On some servers, you must add


Options +FollowSymLinks

before trying to use any mod_rewrite directives. If FollowSymLinks is not already enabled in httpd.conf, then you must do it in .htaccess. If adding that directive causes a server error, that's an idication that mod_rewrite is not allowed on the server, because AllowOverride Options is not configured.

Jim

omoutop

2:22 pm on Feb 15, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



thanks for replying....

Options +FollowSymLinks is already in htaccess file,
mod_rewrite is supported i think ( i get no server errors)

Still "Page no found" is all i got..

i will try to contact the server admin and see what can be done with my problem...

thanks again

omoutop

7:13 am on Feb 17, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



well, is seems that domain name affects htaccess commands.

when a domain name substitues ip address (www.test.com instead of #*$!.xxx.xxx.xxx) htaccess works fine.

So take care all of you who transfer sites between servers :)

jdMorgan

7:39 am on Feb 17, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



{quote} mod_rewrite should still work, with the possible exception that your hard-coded external redirects would still go to the old server.{/quote}

Instead of using, for example:


RewriteRule ^foo\.html$ http://example.com/bar.html [R=301,L]

You would want to use

RewriteRule ^foo\.html$ http://%{HTTP_HOST}/bar.html [R=301,L]

for a more-portable solution.

You asked specifically if the domain name affected mod_rewrite, and I replied as quoted above -- Basically, No.
But what may affect the code is the /~username subdirectory-level added to your URL. Your rules would need to take that into account. Look at the RewriteBase directive for a possible solution.

Jim