PDA

View Full Version : htaccess rewrite problem???



Danil
04-26-2010, 02:00 AM
how could i change my site link "www.xxxx.com/xxxx/....html" into "www.xxxx.com...html" ?

xxxx is stand for my domain

I install my zen cart site in public_html/xxxx/
and I use .htaccess so that I could visit the homepage as www.xxxx.com

but when I open any page of the site the url link change into www.xxxx.com/xxxx/.....html

How could I solve this problem by htaccess?

Falcon1986
04-26-2010, 01:57 PM
What rules are you using within .htaccess?

Might want to try this:

~/public_html/.htaccess

RewriteEngine on
RewriteCond $1 !^xxxx/
RewriteRule (.*) /xxxx/$1 [L]

Where 'xxxx' is the subdirectory name. This (http://www.webmasterworld.com/apache/3388596.htm) is the webmasterworld.com thread from which this rule was taken. Note the limitations.

Danil
04-27-2010, 03:58 AM
Thanks for your help, I still don't know how to change the code.

Where and what code should I change, Please any advice.
here is the code I use in my public_html/.htaccess

code


# Hostmonster.com
# .htaccess main domain to subdirectory redirect
# Copy and paste the following code into the .htaccess file
# in the public_html folder of your hosting account
# make the changes to the file according to the instructions.
# Do not change this line.
RewriteEngine on
# Change yourdomain.com to be your main domain.
RewriteCond %{HTTP_HOST} ^(www.)?xxxx.com$
# Change 'subdirectory' to be the directory you will use for your main domain.
RewriteCond %{REQUEST_URI} !^/xxxxx/
# Don't change this line.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Change 'subdirectory' to be the directory you will use for your main domain.
RewriteRule ^(.*)$ /xxxxx/$1
# Change yourdomain.com to be your main domain again.
# Change 'subdirectory' to be the directory you will use for your main domain
# followed by / then the main file for your site, index.php, index.html, etc.
RewriteCond %{HTTP_HOST} ^(www.)?xxxx.com$
RewriteRule ^(/)?$ xxxxx/index.php [L]