Jump to content

RewriteCond


themistral

Recommended Posts

Hi guys,

 

I've still not got my head around regex.

 

Basically, Google Webmaster Tools shows I have a problem showing up where the url is being formatted as

http://www.domain.com/sub1/http://domain.com/sub1/sub2/filename.html

I need the url to be

http://www.domain.com/sub1/sub2/filename.html

 

Now, I know I need to fix that and I have a support request waiting from the software hosts, but I want to fix it within htaccess for the time being.

 

I was thinking of something like this:

RewriteCond %{REQUEST_URI} ^[A-Za-z0-9]http://domain.com[A-Za-z0-9]$

to check if the URI contains the non-www version of the url

But I don't know if this will work or how to write the rule.

 

The tutorials I've found are quite basic and so if anyone can either help me out or point me to a more in depth tutorial I would be very grateful!

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/221637-rewritecond/
Share on other sites

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.