general help with specific problem

Discuss practical ways rearrange URLs using mod_rewrite.

general help with specific problem

Postby uzisuicide » Wed Aug 12, 2009 1:43 am

Morning, first time post looking for some mod-rewrite assistance and pointers, hopefully I'm in the right place :)

I have a site working perfectly well for a few years , the guy who created it set it all up with nice clean url's via mod rewrite. I am cloning the site and re tasking it for another purpose and to this end I have moved the entire thing lock stock and barrel to a new server. The first major problem I have encountered is of course with the mod rewrite.

I have the original settings from the working website and have simply altered them to include the new url im using.

The original working code :

Code: Select all
UseCanonicalName OFF
   RewriteEngine on
   RewriteCond %{HTTP_HOST} !^www\.xxxxx\.com$
   RewriteRule ^(.*)$ http://www.xxxxx.com$1 [R=301,QSA,L]
   RewriteRule ^/(assets|admincp)/(.*) - [L]
   RewriteRule ^/(.*)([^/])$ /$1$2/ [R=301]
   RewriteRule ^/(.*)$ /index.php [QSA]


I stress again this is working fine on my exisiting website. It's running on the same Centos with the same modules active (if that makes any difference)..

The site I am trying to get it working on is http://xtgnv2.uzisuicide.co.uk and these are the changes i have made to get it working, sadly this ends in a redirect loop.

Code: Select all
   RewriteEngine on
   RewriteCond %{HTTP_HOST} !^http://xtgnv2\.uzisuicide\.co\.uk$
   RewriteRule ^(.*)$ http://xtgnv2.uzisuicide.co.uk$1 [R=301,QSA,L]
   RewriteRule ^/(assets|admincp)/(.*) - [L]
   RewriteRule ^/(.*)([^/])$ /$1$2/ [R=301]
   RewriteRule ^/(.*)$ /index.php [QSA]


(UseCanonicalName OFF) is already set globally. Please note that on the rewriteCond line i have added the http:// as without it , it appears to do nothing at all.

Assuming that since it all works fine on another box with a different URL and that the code is ok, are there any other settings on the box i should be looking at to get this to work.

Spent 20 of the last 24 hours working on this and im just going around in circles now with no new ideas to try. Any advice/ideas/assistance anyone is able to lend would be massively appreciated.

Fingers crossed I have made a simple schoolboy error somebody is going to spot and point out! If of course there is any further information I need to post to help solve this problem - please do say so and I'll get right on it!
uzisuicide
 
Posts: 1
Joined: Wed Aug 12, 2009 1:29 am

Postby richardk » Wed Aug 12, 2009 11:15 am

Try
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} !^http://xtgnv2\.uzisuicide\.co\.uk$ [NC]
RewriteRule ^(.*)$ http://xtgnv2.uzisuicide.co.uk/$1 [R=301,L]

RewriteRule ^(assets|admincp)/(.*) - [L]

RewriteRule ^(.*[^/])$ /$1/ [R=301,L]
RewriteRule .* /index.php [QSA,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Re: general help with specific problem

Postby uzisuicide » Mon May 10, 2010 5:32 am

thanks didnt work, gone round bend now lol.
uzisuicide
 
Posts: 1
Joined: Wed Aug 12, 2009 1:29 am


Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: Google [Bot] and 24 guests

cron