Forum Moderators: phranque

Message Too Old, No Replies

Having issues with htaccess in vbulletin

         

pityocamptes

3:09 am on Oct 5, 2014 (gmt 0)

10+ Year Member





Here is my htaccess. I have noticed that when I click on the link for the classifieds mod, it redirects me back to the main forum. I know that the htaccess is setup to redirect back to https, and is working great - not sure what is going on. Any help appreciated. The code in question is the OZZMODZ portion below...

# Use PHP 5.3
AddType application/x-httpd-php53 .php .html .htm


<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>


RewriteEngine on
RewriteBase /

RewriteCond %{HTTP_HOST} !^www.xxxxxxxxxxxxxxxxxx.com$ [NC]
RewriteRule ^(.*)$ /$1 [R=301,L]

RewriteCond %{SERVER_PORT} !443
RewriteRule (.*) [xxxxxxxxxxxxxxxxx.com...] [R=301,L]

# If you are having problem with "None Could Be Negotiated" errors in Apache, uncomment this to turn off MultiViews
Options -MultiViews

RewriteCond %{REQUEST_URI} !(xxxxxxxxxxxxxxxxxxxxxxxxxxx\.php)
RewriteRule ^((archive/)?(.*\.php(/.*)?))$ xxxxxxxx.php [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !/(xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)/
RewriteRule ^(.+)$ xxxxxxxxxxx.php [L,QSA]

**RewriteRule ^classifieds/([^/]*)/ ./ozzmodz_classifieds.php?do=main&catid=$1 [L,NC]
RewriteRule ^sale/([^/]*)/ ./ozzmodz_classifieds.php?do=viewitem&itemid=$1 [L,NC]
RewriteRule ^wanted/([^/]*)/ ./ozzmodz_classifieds.php?do=viewitem&itemid=$1 [L,NC]
RewriteRule ^trade/([^/]*)/ ./ozzmodz_classifieds.php?do=viewitem&itemid=$1 [L,NC]
RewriteRule ^offer/([^/]*)/ ./ozzmodz_classifieds.php?do=viewitem&itemid=$1 [L,NC]
RewriteRule ^seller/([^/]*)/ ./ozzmodz_classifieds.php?do=seller&sellerid=$1 [L,NC]**

<IfModule mod_headers.c>
<FilesMatch "\.(bmp|css|flv|gif|ico|jpg|jpeg|js|pdf|png|svg|swf|tif|tiff)$">
Header set Cache-Control "max-age=172800, public"
</FilesMatch>
</IfModule>

<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType application/javascript A604800
ExpiresByType application/x-javascript A604800
ExpiresByType text/javascript A604800
ExpiresByType text/css A604800
ExpiresByType image/gif A604800
ExpiresByType image/x-icon A604800
ExpiresByType image/icon A604800
ExpiresByType image/jpg A604800
ExpiresByType image/jpeg A604800
ExpiresByType image/png A604800
ExpiresByType text/html A604800
</IfModule>

phranque

10:31 am on Oct 16, 2014 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



when I click on the link for the classifieds mod, it redirects me back to the main forum

it would be useful to know what the request and response looked like.
is that an http: url?
if so, this would explain the response:
RewriteCond %{SERVER_PORT} !443
RewriteRule (.*) https://www.xxxxxxxxxxxxxxxxx.com [R=301,L]


RewriteBase /

RewriteCond %{HTTP_HOST} !^www.xxxxxxxxxxxxxxxxxx.com$ [NC]
RewriteRule ^(.*)$ /$1 [R=301,L]

you don't need the RewriteBase directive here.

you probably want to use this code for hostname canonicalization:
RewriteCond %{HTTP_HOST} !^(www.example.com)?$ [NC]
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]