Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Simple to some .htaccess setup.

The next step to my .htaccess file



6:36 pm on Jun 6, 2005 (gmt 0)

10+ Year Member

To deal with the www. vs non-www I have the following and it works fine.

RewriteEngine on
RewriteCond %{HTTP_HOST}!^www\.site\.com
RewriteRule ^(.*)$ [site.com...] [R=301,L]

Now, I want to rewrite my url's that have dynamic content so they are more search engine / user friendly. Everything I read and try does not seem work for me.

I added the following:

Options +FollowSymLinks
RewriteRule file(.*)\.htm$ /file.php?prod=$1

But when I go to a page www.site.com/file.php?prod=1 the url does not change. I think I need a jump start to help me understand.



11:27 pm on Jun 6, 2005 (gmt 0)

10+ Year Member

You visit the url www.site.com/file123.html and it goes to the dynamic page without changing the url. Going to file.php?prod=123 will also link the same page but the url will be the dynamic one.

If I've got this wrong excuse me, I'm a complete newbie :S


12:35 am on Jun 7, 2005 (gmt 0)

10+ Year Member

Actually, What I am trying to accomplish is to have someone / search engines go to www.site.com/file.php?prod=123 and have the url re-written as www.site.com/file123.php


12:50 am on Jun 7, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

Hi Monksp,

The basic problem is you are going the wrong way...

The link must be to the static page (does not exist), then use mod_rewrite to serve the information from the php page (does exist).

This should give you an idea:



2:24 pm on Jun 7, 2005 (gmt 0)

10+ Year Member

I think this is exactly what I needed to help me to accomplish what I want to do. Great post jd01, especially to us .htacess newbies.

Featured Threads

Hot Threads This Week

Hot Threads This Month