Jump to content

subdomain redirecting to actual subfolder (but dont want it to)


ozestretch

Recommended Posts

This is a lead on of a previous question (which was solved but may have caused this issue)

 

This is how I want it to operate.

 

domain.com, domain.com/xxxx to have trailing slashes

 

domain.com/xxxx+, domain.com/xxxx+all to not have trailing slashes

 

www.domain.com redirect without www

 

sub.domain.com to not inherit any rules if possible - currently redirects to actual subfolder domain.com/sub/

 

domain.com/anyfilename.php to be domain.com/anyfilename/

 

(go.php checks to see if database record, if not it checks for actual file/folder)

 

<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]|/)$
RewriteCond %{REQUEST_URI} ([^+])$
RewriteCond %{REQUEST_URI} !([a-zA-Z0-9]\+(all))$
RewriteRule (.*)$ http\:\/\/domain\.com\/$1\/ [QSA,R,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{HTTP_HOST} !^domain\.com$ [NC]
RewriteRule ^(.*)$ http\:\/\/domain\.com\/$1 [QSA,L,R]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([0-9A-Za-z]+)/?$ /go.php?id=$1 [QSA,L]
RewriteRule ^([0-9A-Za-z]+)\+/?$ /info.php?id=$1 [L]
RewriteRule ^([0-9A-Za-z]+)\+all/?$ /info.php?id=$1&all=1 [L]
</IfModule>

 

it all 'seems' to do as I want, except the subdomain issue :(

 

thanks, made me look at the whole PICTURE....

::)

Redirect 301 /index.php http://domain.com/home/

 

forgot I had that outside my mod_rewrite

 

removed and added a php 301 header redirect in index.php

 

is there a better way in .htaccess to do Redirect 301 /inde.... etc?

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.