| Welcome to WebmasterWorld Guest from 18.104.22.168 |
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
|Become a Pro Member|
|Simple to some .htaccess setup.|
The next step to my .htaccess file
To deal with the www. vs non-www I have the following and it works fine.
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:
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.
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
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
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:
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.
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved