Jump to content

Simple Redirect


3s2ng

Recommended Posts

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.

Sample.

I have a page like this

http://mydomain.com/page1.html
  - 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/var/chroot/home/content/t/e/s/test/html/files/page1.php

Hope you can help me with this simple problem.

Thanks
MARK
Link to comment
Share on other sites

Do you mean something like

[font=Courier]RewriteRule ^(.*)\.html$ $1.php[/font]

which will make [font=Courier]anything.php[/font] show-up instead of [font=Courier]anything.html[/font]?  The [font=Courier]$1[/font] will be whatever is found in the parenthesis.  Hope this helps!
Link to comment
Share on other sites

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.