Jump to content

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?

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.