Jump to content

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?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.