Other htaccess

fus10n

VIP Member
VIP Member
Joined
Sep 5, 2016
Messages
1,128
Reaction score
819
Hey, i've had to move a friends site from root to a folder and thats caused me problems.

It does not show the main site but successfully send tablets etc to the mobile site. I think the htaccess needs to be updated to include the new subdirectory but can't seem find where to put it!

I can create a htaccess with a redirect without the mobile divert and it shows main site no problems!

anyone help. Heres the code, i have removed the domainname and replaced it with mydomain for security!

A new site is being created thats responsive but its a while off so something of a stop gap is needed.

Code:
You don't have permission to view the code content. Log in or register now.
 
think i may have solved my issue and cut the htaccess down by a few lines in the process!

(no I'm not an expert but i can google kinda great, found it on stackoverflow,)

Code:
You don't have permission to view the code content. Log in or register now.
 
sorted it and the solution was simple. It may be sloppy but it works and should work until the new site is up and running.
This is the code for the root and the old mobile redirect is in the subfolder. I used the rewriteoption inheritdown to give the htaccess folder in the subdirectory to work.

RewriteEngine on
RewriteBase /
RewriteOptions InheritDown

RewriteCond %{REQUEST_URI} !^/subdriectory/

# Rewrites all URLS [Replace "example" with the actual domain, without the TLD (.com, .net, .biz, etc)]
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.

# Rewrite all those to insert /folder
RewriteRule ^(.*)$ /subdirect/$1 [L]
 
...the plot thickens. This does show the main site and it directs mobiles to the mobile site. One of their equipment has stopped working.

I now need to find a way to exclude one folder in the root from being diverted.....
 
Back
Top