I can't seem to get a .htaccess redirect to work on a site i'm working on,
I've tried all sorts of setups but the one that should be working still gives a 404, heres the file:
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^register register.php [QSA]
RewriteCond $1 !^(index\.php|login\.php|register\.php|phpmyadmin|images|public|assets|uploads|themes|install|updates|asset|robots\.txt)
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
The file exists in the www/ directory
Any help would be appreciated as I seem to be having a blonde moment.
Update:
I'm trying to get domain.com/register to load domain.com/register.php, basically trying to remove the file extension.
Try with following code .
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://domain.com/register/$1 [R=301,L]
Some online tools available . Just search in Google " Htaccess generator"
You might want to try a different approach. Try using a condition to stop rewriting for physical files and/or folders, and then just redirect the simple paths.
# Stop rewriting physical paths
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule .* - [L]
# Rewrite virtual paths
RewriteRule ^register /register.php [PT,L]