Jump to content

rewrite domain.com/ to domain.com/home


Revlet

Recommended Posts

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!

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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  ;)

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.