[solved] Pretty URL's with mod_rewrite not working
Posted: Wed Jan 16, 2008 5:53 pm
I've read of similar problems in the forum but the solutions proposed do not work for me so here goes...
I am able to get Internal Pretty URL's to work.
The problem is that I am unable to get Pretty URL's using mod_rewrite to work.
Here is my .htaccess file:
Here is my config.php file:
The home page of my site displays, but as soon as I click on any other link, I get a 404 Not Found error
If I manually insert an 'index.php' into the URL of the page that generated the error, then the page shows up.
So this is obviously a very simple error in configuration somewhere, but I do not know how to fix it.
I will add the eventual 'fix' to the documentation wiki once I've learned the answer.
thanks.
I am able to get Internal Pretty URL's to work.
The problem is that I am unable to get Pretty URL's using mod_rewrite to work.
Here is my .htaccess file:
Code: Select all
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
# Turns off directory browsing
# not absolutely essential, but keeps people from snooping around without
# needing empty index.html files everywhere
Options -Indexes
# No sense advertising what we are running
ServerSignature Off
# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]
# URL Filtering helps stop some hack attempts
#IF the URI contains a "http:"
RewriteCond %{QUERY_STRING} http\: [OR]
#OR if the URI contains a "["
RewriteCond %{QUERY_STRING} \[ [OR]
#OR if the URI contains a "]"
RewriteCond %{QUERY_STRING} \] [OR]
#OR if the URI contains a "<__script__>"
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
#OR script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
#OR any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
RewriteRule ^.*$ - [F,L]
# END Filtering
# CMSMS Rewriting
# Set assume mod_rewrite to true in config.php and clear CMSMS cache
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
# END CMSMS
Code: Select all
#------------
#URL Settings
#------------
$config['assume_mod_rewrite'] = true;
$config['page_extension'] = '.html';
$config['internal_pretty_urls'] = false;
$config['use_hierarchy'] = true;
$config['query_var'] = 'page';
Code: Select all
Not Found
The requested URL /index.php was not found on this server.
So this is obviously a very simple error in configuration somewhere, but I do not know how to fix it.
I will add the eventual 'fix' to the documentation wiki once I've learned the answer.
thanks.