Welcome to WebmasterWorld Guest from 54.196.244.206

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)

New User

10+ Year Member

joined:Jan 21, 2004
posts:27
votes: 0


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.

Thanks!

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

Junior Member

10+ Year Member

joined:June 5, 2005
posts:46
votes: 0


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 June 7, 2005 (gmt 0)

New User

10+ Year Member

joined:Jan 21, 2004
posts:27
votes: 0


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 June 7, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 9, 2005
posts:1509
votes: 0


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:
[webmasterworld.com...]

Justin

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

New User

10+ Year Member

joined:Jan 21, 2004
posts:27
votes: 0


Thanks!
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.
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members