Jump to content

[SOLVED] .htaccess and php extensions


defeated

Recommended Posts

Hi,

I want to put some 301 redirects into my htaccess file but the redirects are for dynamic pages.

Does anybody know if it is possible to write something like the following:

 

Redirect 301 /oldpage.php?* http://www.example.com/newpage.php?*

 

I don't want to break my site.

Cheers.

Link to comment
https://forums.phpfreaks.com/topic/110034-solved-htaccess-and-php-extensions/
Share on other sites

Thanks for that but I'm not sure I entirely follow it. Could you explain what each part does?  Do I have to define $1?

Or does that code as it is work for everything? (changing the oldpage and newpage paramaters of course).

Thanks for your help.

If yahoo was any good at keeping up with changes none of this would be necessary, but I'm getting a lot of bounces from them.

  • 2 weeks later...

ok, so it took a few more days for me to get around to it.

Didn't work.

Heres what I did.

 

renamed the .htaccess file by removing the . so that I could view it in my editor.

It was an empty when I opened it.

I wrote the following.

RewriteEngine On
RewriteRule jobs.php/(.+) jobs_ireland.php/$1 [NC,R=301]

I wrote a few more lines for other pages but exactly the same as the one above.

I get 404 not found if I type in www.jackiebrownmedical.ie/jobs.php?url=jobs

Where did I go wrong?

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.