homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

Simple to some .htaccess setup.
The next step to my .htaccess file

 6:36 pm on Jun 6, 2005 (gmt 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.




 11:27 pm on Jun 6, 2005 (gmt 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 Jun 7, 2005 (gmt 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 Jun 7, 2005 (gmt 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:



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

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.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved