|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
.Htaccess file
I am working on some client projects and want to remove the canonical issue. Therefore, i created .htaccess file on the root of the server and its working fine. By doing this all the non www url of the website is redirected to open with www url.
But still i am facing a little problem. I am not able to redirected /index.php page and ./index.html page to absolute URL of the website. The problem is with both .co.uk and .com domain. Kindly provide suggest. |
|
#2
|
||||
|
||||
|
Use this:
For redirecting www.domain.com/index.php to / RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.php\ HTTP/ RewriteRule ^(.*)index\.php$ http://www.domain.com/$1 [R=301,L] For redirecting /index.html to / RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.html\ HTTP/ RewriteRule ^(.*)index\.html$ http://www.domain.com/$1 [R=301,L] **replace domain.com with your site URL
__________________
SEO FAQs - You might find your answer here. SEOchat Forum Rules - Read Before You Post **Do what you feel in your heart to be right- for you'll be criticized anyway. You'll be damned if you do, and damned if you don't.** Last edited by pro_seo : June 10th, 2008 at 04:18 AM. |
|
#3
|
|||
|
|||
|
Thanks
Hi,
Thanks for the message. I implemented the both given code for my websites and its working fine. But i am still looking for .htaccess file code for .co.uk domain. Is someone using this code, please share it. Domain name: www dot domainname dot co dot uk Website developed in PHP. Last edited by rohitb : June 10th, 2008 at 05:00 AM. |
|
#4
|
||||
|
||||
|
Quote:
So? What's the problem... Just replace domain.com in the above codes with domain.co.uk i.e - your .co.uk domain URL Simple! |
|
#5
|
|||
|
|||
|
I have already checked this but its not working. If you are working on any .co.uk domain then provide me the htaccess file code.
|
|
#6
|
||||
|
||||
|
Does your host -- where the .co.uk site resides -- allow the use of .htaccess? Is it even an Apache server?
|
|
#7
|
|||
|
|||
|
I can redirect the non www url to www url but not able to redirect /index.php to the absolute URL. I will ask the same to the website hosting provider.
Thanks for suggestion. |
|
#8
|
||||
|
||||
|
Quote:
Show us your domain URL and also the entire content of your HTACCESS. Maybe then we could guide you on this |
|
#9
|
|||
|
|||
|
As i am new member of seo chat i couldn't post links till 17 june & 30 post.
Well thanks for your kind help. |
|
#10
|
||||
|
||||
|
Quote:
You can post in this format: domain(dot)co(dot)uk |
|
#11
|
|||
|
|||
|
RewriteEngine On
rewritecond %{h t t p _ h o s t} ^domain(dot)co(dot)uk rewriteRule ^(.*) h t t p : / / www(dot)domain(dot)co(dot)uk/$1 [R=301,L] RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.php\ HTTP/ RewriteRule ^(.*)index\.php$ http : / / www(dot)domain(dot)co(dot)uk/$1 [R=301,L] Note: please ignore space at some places. |
![]() |
| Viewing: SEO Chat Forums > Other > SEO Scripts > .Htaccess file |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|