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
Share on other sites

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.