View Single Post
Old 05-02-2010, 05:48 PM  
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,243
Quote:
Originally Posted by tonyparra View Post
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]
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote