PDA

View Full Version : Single page re-writes


Glen
11-18-2006, 11:54 AM
My site used to be in asp and over that time i got a lot of links to individual pages ending in .asp

the site is now in php and i see those asp pages have pr3 some of them, so would like to re-write the asp page to the php version

how would i go about doing this :)

Paz
11-18-2006, 06:59 PM
Hi Glen,

it's very easy if you have access to mod rewrite. Let me get this straight though. You want to have all asp pages redirected to their php equivalent eg default.asp redirects to default.php and so on?

Cheers,
Paz.

Jocelyn
11-18-2006, 07:07 PM
I would say it's ...

Old filename = file.asp
New filename = file.php

Make the actual file.php be rewriten to show file.asp

Glen
11-19-2006, 10:08 PM
yes they used to be .asp and now php

i want them to show as php also

Blazingpie
11-20-2006, 06:11 AM
then its a simple matter of taking any request for a .asp file and either using a mod_rewrite to change it to a .php or use a 301 redirect to the correct file

Chatmaster
11-20-2006, 07:12 AM
Linux... the only choice you have is to use modrewrite to permanently redirect each and every page. You are fortunate that it is not a windows server, then it was a near imposible task...

Paz
11-20-2006, 08:47 PM
Hi,

there are a few ways you can do it, but this should work, if not let me know:

Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*)\.asp$ $1.php [nc]

Cheers,
Paz.

Glen
11-20-2006, 10:36 PM
didnt seem to do anything

Paz
11-21-2006, 10:44 AM
Does htaccess actually work ie can you do a redirect like

redirect 301 /invalid-filename.html valid-filename.html

If the htaccess is still in place, post the url so I can make a check with a server analyser.