I am new to Joomla and WAMP. I use the WAMP environment:
- Win Srv 2003 R2 (Std Ed) with Service Pack 2 (SP2) and all the latest updates
- Apache 2.2.9
- PHP 5.2.6
- Joomla 1.5.14
I want to enable mod_rewrite with the Joomla SEF URL, but it does not work together.
If I set “SEF URLs” and “Add suffix to URLs” as “Yes”, this works.
Result:/index.php/page.html
If I set 'mod_rewrite' and 'Add suffix to URL' as Yes, it does not give any error (not sure if it works the way it is supposed to or not). Result:/index.php?option=com_content&view=article&id=3&Itemid=5
If I set the “SEF URLs” and “mod_rewrite” to “Yes,” it gave me the “404 Not Found” error.
Result: Not found | The requested URL was /pagenamenot found on this server
If I set "SEF URLs" + "mod_rewrite" + "Add suffix to URL" as "Yes", this will result in a "404 Not Found" error.
Result: Not found | The requested URL was /pagename.htmlnot found on this server
I use the default .htaccess provided by Joomla, the following code:
## Can be commented out if causes errors, see notes above.
Options + FollowSymLinks
#
# mod_rewrite in use
Rewriteengine on
########## Begin - Rewrite rules to block out some common exploits
## If you experience problems on your site block out the operations listed below
## This attempts to block the most common type of exploit `attempts` to Joomla!
#
# Block out any script trying to set a mosConfig value through the URL
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
# Block out any script that includes a tag in URL
RewriteCond %{QUERY_STRING} (\|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Send all blocked request to homepage with 403 Forbidden error!
RewriteRule ^(.*)$ index.php [F,L]
#
########## End - Rewrite rules to block out some common exploits
# Uncomment following line if your webserver URL
# is not directly related to physical file paths.
# Update Your Joomla! Directory (just / for root)
RewriteBase /abc
# /abc is a sub-directory of joomla install in htdocs
########## Begin - Joomla! core SEF Section
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$ [NC]
RewriteRule (.*) index.php
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
#
########## End - Joomla! core SEF Section
httpd.conf
LoadModule rewrite_module modules/mod_rewrite.so active (uncommented #)- mod_rewrite.so Apache.
, , . . .
PHP_MAILER, , . . , , .
DM