Quote:
Originally Posted by tonyparra
Hello. I have some issues with the mod_rewrite. My situation is i have domain like so with wordpress being installed on the tld www.domain.com. I have .php pages though, that i cant import into wordpress, they are like so www.domain.com/1/page.php, www.domain.com/2/page.php, and so on. I would like to rewrite those .php extensions into .html or .htm. My problem is when i add this rules
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*)\.htm$ $1.php [NC]
it doesnt work and i cant log into my wordpress backend. I added that to the .htaccess file on the root level, and didnt touch any of the other wordpress stuff. Anyone know how to properly do this?
|
this will check to make sure a .html file doesnt exist already
http://www.domain.com/site.php will work as
http://www.domain.com/site.html
as well as dirs
http://www.domain.com/directory/sammy.php will work as
http://www.domain.com/directory/sammy.html
Code:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{REQUEST_URI} ^(/.+\.)html$ [NC]
RewriteCond %{DOCUMENT_ROOT}%1php -f
RewriteRule \.html$ %1php [NC,QSA,L]