Forum Moderators: phranque

Message Too Old, No Replies

Change name of page without redirecting

         

chopin2256

7:46 am on Sep 3, 2005 (gmt 0)

10+ Year Member



I am transferring my website from static to dynamic. I have many valuable static pages. I am going to use redirects one by one for these pages, since they are static, and don't really follow a pattern, so the coding shouldn't be too hard.

Lets say I have a page called /static.html. So this is the static page...I then write the page in mediawiki which is dynamic. So the output from mediawiki will be called folder/dynamic. I then want to change the name of "folder/dynamic" to static.html but I do not want the page to redirect to static.html, I just want the name of the page to change, so it keeps the contents of folder/dynamic

This is what I sort of want, but is not quite right:

Options +FollowSymLinks
RewriteEngine on
RewriteRule ^static\.html$ folder/dynamic [R=301,L]

Can someone direct me on how to just change the name without redirecting the page? Thanks!

jdMorgan

3:09 pm on Sep 3, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You want an internal [b]rewrite[/i], not an external redirect. By definition, a redirect tells the browser to ask for the content it requested at a different or new address, and this changes the browser address bar. An internal rewrite simply changes the filename associated with an incoming requested URL.

However, you will need to make sure your content-creation script outputs static links when creating pages. Mod_rewrite can change the incoming requested URL, but it cannot change the URLs on your pages, and these are the URLs seen by users and search engines.

Redirect:


Options +FollowSymLinks
RewriteEngine on
RewriteRule ^static\.html$ http://www.example.com/folder/dynamic [R=301,L]

Rewrite:

Options +FollowSymLinks
RewriteEngine on
RewriteRule ^static\.html$ /folder/dynamic [L]

Jim