Forum Moderators: phranque
Please see below the main part of the .htaccess. Is there something obvious that might need changing? Thanks in advance!
# SEARCH ENINGE FRIENDLY URLS
<IfModule mod_php4.c>
php_value session.use_trans_sid 0
</IfModule>Options +FollowSymLinks
RewriteEngine on
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.(php¦html?)\ HTTP/
RewriteRule ^([^/]+/)*index\.(php¦html?)$ http://www.example.com/$1 [R=301,L]
#RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteRule (.*) http://www.example.com/$1 [R=301.L]
#
RewriteRule listing-(.*?)-([0-9]*).html index.php?action=listingview&listingID=$2 [L]
RewriteRule page-(.*?)-([0-9]*).html index.php?action=page_display&PageID=$2 [L]
RewriteRule searchresults.html index.php?action=searchresults [L]
RewriteRule agents.html index.php?action=view_users [L]
RewriteRule view_favorites.html index.php?action=view_favorites [L]
RewriteRule calculator.html index.php?action=calculator&popup=yes [L]
RewriteRule saved_searches.html index.php?action=view_saved_searches [L]
RewriteRule listing_image_([0-9]*).html index.php?action=view_listing_image&image_id=$1 [L]
RewriteRule logout.html index.php?action=logout [L]
RewriteRule member_signup.html index.php?action=signup&type=member [L]
RewriteRule agent_signup.html index.php?action=signup&type=agent [L]
RewriteRule member_login.html index.php?action=member_login [L]
RewriteRule edit_profile_([0-9]*).html index.php?action=edit_profile&user_id=$1 [L]
RewriteRule agent-([^-]*)-([0-9]*).html index.php?action=view_user&user=$2 [L]
mod_rewrite acts *after* a user clicks on one of your links, sending an HTTP request to your server. Mod_rewrite receives this request, and can do one of several things. The most common actions are to internally rewrite the request to a different file path that what would be expected if the rewrite was not present, or to generate an external redirect to tell the browser to ask for the requested resource again, using a different URL.
Mod_rewrite cannot change the links that appear on your CMS-generated pages -- only your CMS can do that.
You'll need to modify your CMS to produce the correct URLs, and then mod_rewrite will rewrite them, when they are received from the client, to your "index.php" script.
For more information on the client-server transaction, and when and how mod_rewrite comes into play, see this thread, "Changing Dynamic URLs to Static URLs [webmasterworld.com]."
Additional information is available in our Forum Charter, and in the Apache forum Library -- See links at top of this page.
Jim