Hi,
I'm trying to get mod-rewrite to work on an add-on domain, that is located in a subdirectory of my main site.
I'm using mod-rewrite in my main domain and directory (were it works fine) and I'm not sure if that would effect a subdomain.
Any tips?
Thanks,
Cybercog
Mod Rewrite and subdomains
Moderator: General Moderators
Here is my fix.
First: I had to put my .htaccess in the root web dir, not my addon domain subdirectory.
I'm not sure how you would do it with the ,htaccess in the sub dir.
I hope this helps anyone else trying to do this.
Thanks,
Cybercog
First: I had to put my .htaccess in the root web dir, not my addon domain subdirectory.
I'm not sure how you would do it with the ,htaccess in the sub dir.
Code: Select all
Options FollowSymLinks Includes ExecCGI
DirectoryIndex index.html home.htm index.php
AddType application/x-httpd-cgi .cgi
AddType application/x-httpd-cgi .py
AddType application/x-httpd-cgi .pl
AddType application/x-httpd-php .php
AddType application/x-httpd-php .phtml
AddType text/x-server-parsed-html .html
AddType text/x-server-parsed-html .shtml
AddType text/x-server-parsed-html .htm
AddType application/x-type-map var
AddType audio/midi mid
# Error no page control redirects url
ErrorDocument 500 http://www.mysite.com
ErrorDocument 404 http://www.mysite.com
# MOD REWRITE ################
RewriteEngine on
######################################################################
RewriteCond %{HTTP_HOST} ^[www\.]*sub-domain.top-domain.com [NC]
RewriteCond %{REQUEST_URI} !^/sub-domain-dir/.*
# The following is my lame attempt to do this, but it works.
RewriteRule ^index /index.php
RewriteRule ^index/ /index.php
RewriteRule ^index/(.*)/(.*)/(.*) /index.php?v=$1&p=$2
RewriteRule ^index/(.*)/(.*)/(.*)/(.*) /index.php?v=$1&p=$2&id=$3&pid=$4Thanks,
Cybercog