Jump to content

[SOLVED] URL Rewrites


vbnullchar

Recommended Posts

i have this link "http://server/directory/" which is the old url of our server, but yesterday we change the name of our server to something like this "http://server2/directory/" the problem now is there are thousands of records in our db that has the url of our old server.

 

is possible to have something like this <a href=http://server/directory/>Home</a> but will go to "http://server2/directory" instead.

 

:note, the old server doesnt exists anymore so i cannot make some redirect scripts from the old server to the new one.

 

thanks alot,

Link to comment
https://forums.phpfreaks.com/topic/65356-solved-url-rewrites/
Share on other sites

Sooooooo

 

What happened to Server1?

 

Do you still have any access to it?  Because you'd need to do something to Server1 to get a rewrite to work.  Do you own the domain name of Server1?  Can you move it to Server2?

 

You see, if I own crazywebsites.com and you steal it, I can't make anything on that site go to my new site at crazywebsitestoo.com unless I have some access to the original server or atleast the original domain.

 

Does that make sense?

Link to comment
https://forums.phpfreaks.com/topic/65356-solved-url-rewrites/#findComment-326382
Share on other sites

server2 was the old server1, we re-setup and change name..

 

heres what i got in my .htaccess, i found is here http://www.ilovejackdaniels.com/apache/mod_rewrite-cheat-sheet/

 

# Site has permanently moved to new domain

RewriteCond  %{HTTP_HOST}    ^www.domain.com$  [NC]

RewriteRule  ^(.*)$  http://www.domain2.com/$1 [R=301,L] TIME_SEC

 

can you modify this code to fit the urls below?

 

server1 = http://intranet/portal

server2 = http://iportal/home

Link to comment
https://forums.phpfreaks.com/topic/65356-solved-url-rewrites/#findComment-326395
Share on other sites

heres what i have

 

RewriteCond %{HTTP_HOST} ^http://intranet/$ [NC]
RewriteRule ^(.*)$ http://iportal/$1 [R,L]

 

http://intranet/ redirects to http://iportal/home.. this is okay but

http://intranet/portal/?action=view  --> is requested URL not found.

 

Link to comment
https://forums.phpfreaks.com/topic/65356-solved-url-rewrites/#findComment-329558
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.