Jump to content


Simple Redirect

  • Please log in to reply
1 reply to this topic

#1 3s2ng

  • Members
  • PipPipPip
  • Advanced Member
  • 45 posts

Posted 21 September 2006 - 11:23 PM

Hello Freaks,

I'm having a problem with a simple mod rewrite redirections.

Heres the scenario.

I have a bunch of pages which are all under advertisements like google, yahoo, etc.


I have a page like this

  - I have submitted that URL for advertisements and I have a new page for that but I dont want to update my advertisements. All I want is to change that page1.html into something like page1.php

You noticed that I only change the extension.

I have something like this in my .htaccess file

RewriteEngine on
RewriteRule ^page1\.html$ page1\.php

Using that above .htaccess file. When i visit. http://mydomain.com/page1.html it will redirect to something like this http://jmydomain.com...files/page1.php

Hope you can help me with this simple problem.


#2 ryanb

  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 22 September 2006 - 03:46 AM

Do you mean something like

RewriteRule ^(.*)\.html$ $1.php

which will make anything.php show-up instead of anything.html?  The $1 will be whatever is found in the parenthesis.  Hope this helps!

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users