LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-06-2008, 02:26 PM   #1
eldojoseph
LQ Newbie
 
Registered: Aug 2008
Posts: 9

Rep: Reputation: 0
htaccess issue


I am trying to write a .htaccess script that fixes canonical links eg: replaces mydomain.com with http://www.mydomain.com, but also redirects the corrected domain to the /shop folder when complete

Here is my code:

Options +FollowSymLinks
RewriteEngine On

RewriteBase /
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTP_HOST} ^([^.]+\.[a-z]{2,6})$ [NC]
RewriteRule ^(.*)$ http://www.%1/$1 [NC]

RewriteCond %{REQUEST_URI} !^/shop [NC]
RewriteRule ^(.*)$ %1/shop [L,R=301]

Can anybody help me revise this...
 
Old 08-06-2008, 05:11 PM   #2
kenoshi
Member
 
Registered: Sep 2007
Location: SF Bay Area, CA
Distribution: CentOS, SLES 10+, RHEL 3+, Debian Sarge
Posts: 159

Rep: Reputation: 32
Code:
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/shop [L,R=301]
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
.htaccess issue - CentOS JDMs14 Linux - Security 4 09-15-2009 04:20 PM
.htaccess-any help fareen Linux - Networking 0 01-20-2006 02:05 PM
.htaccess mod_rewrite issue Jukas Linux - Software 2 12-13-2005 12:23 PM
.htaccess .htpasswd issue Robin01 Linux - Newbie 4 12-24-2003 03:36 PM
.htaccess artistik Linux - Software 1 10-23-2003 03:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration