Revlet Posted December 12, 2009 Share Posted December 12, 2009 I searched, I went through rewrite guides, and yet I still could not make this work. I want my website, http://www.professionalteethcleaning.com/ to automatically amend ".com/home" to all incoming traffic that come in as just ".com/" I tried to make this work with "RewriteRule ^/$ http://www.professionalteethcleaning.com/home$ [R]" (rewrite engine is on earlier in htaccess) but I couldn't get it to work despite trying variations. I am not sure if I need a condition or if my rule is wrong, but if someone could help me out I would really appreciate it. I am a html/css/php guy so this is very foreign to me. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/184837-rewrite-domaincom-to-domaincomhome/ Share on other sites More sharing options...
Revlet Posted December 12, 2009 Author Share Posted December 12, 2009 Oh, and this is my current .htaccess file: DirectoryIndex index.php offline.html RewriteEngine on Options FollowSymLinks RewriteCond %{HTTP_HOST} !^www.professionalteethcleaning.com$ RewriteRule ^(.*)$ http://www.professionalteethcleaning.com/$1 [R=301] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^/]+)/?$ index.php?p=$1& [L,NC] # compress all text & html: AddOutputFilterByType DEFLATE text/html text/plain text/css text/xml <FilesMatch "\.(ico|jpg|jpeg|png|gif|js|css|gz|jgz)$"> Header set Expires "Thu, 15 Apr 2010 20:00:00 GMT" </FilesMatch> RewriteCond %{HTTP:Accept-Encoding} gzip RewriteCond %{REQUEST_FILENAME}.jgz -f RewriteRule (.*)\.js$ $1\.js.jgz [L] AddType "text/javascript" .js.jgz AddEncoding gzip .jgz FileETag none Quote Link to comment https://forums.phpfreaks.com/topic/184837-rewrite-domaincom-to-domaincomhome/#findComment-975741 Share on other sites More sharing options...
cags Posted December 12, 2009 Share Posted December 12, 2009 Which line in that .htaccess is supposed to amend home to the end? You .htccess doesn't even include the word home... RewriteRule ^$ /home [R] Quote Link to comment https://forums.phpfreaks.com/topic/184837-rewrite-domaincom-to-domaincomhome/#findComment-975913 Share on other sites More sharing options...
Revlet Posted December 13, 2009 Author Share Posted December 13, 2009 That was my .htaccess without the line of code (since it didn't work i took it out....i put the whole code there for reference in case something was conflicting with my amateur apache coding) Your code works beautifully by the way, thank you. I appreciate it Quote Link to comment https://forums.phpfreaks.com/topic/184837-rewrite-domaincom-to-domaincomhome/#findComment-976366 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.