Page 2 of 2
Re: HTACCESS - how do you point to another URL with /?
Posted: Mon Dec 01, 2014 9:23 am
by simonmlewis
There will be approx 150 of them. The problem is, we use to use that ip_mobilehome page to point people to a mobile or desktop version of a web site. But the site is now responsive, so we don't need that file.
Might be better to just point a permanent 301 for ip_mobilehome.php straight to the full homeurl, and leave it at that.
But I thought it's better for google (errors) to say "this is actually where it is now pointing"....?!
Re: HTACCESS - how do you point to another URL with /?
Posted: Mon Dec 01, 2014 10:49 am
by simonmlewis
Also, our Wordpress blog has errors like this:
[text]
http://www.site.co.uk/blog/2014/07/URL[/text]
I want to push all that have URL at the end, to point them to the homepage.
This is our current Blog HTACCESS file they write and provide. I don't think I can fix it from the higher level HTACCESS.
Code: Select all
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>
# END WordPress
Re: HTACCESS - how do you point to another URL with /?
Posted: Mon Dec 01, 2014 11:27 am
by Celauran
simonmlewis wrote:Also, our Wordpress blog has errors like this:
Errors like what?
Is URL a literal or a variable?
simonmlewis wrote:I don't think I can fix it from the higher level HTACCESS.
I suspect you may have to.
Re: HTACCESS - how do you point to another URL with /?
Posted: Mon Dec 01, 2014 1:19 pm
by simonmlewis
Well that is the error, tho i admit to you it's nothing.
Google Webmasters has picked it up as an error URL, so it goes to one of their OOOPS pages.
How would I fix it from a higher level if I cannot do it via the Word PRess HTACCESS?
Re: HTACCESS - how do you point to another URL with /?
Posted: Tue Feb 10, 2015 8:50 am
by simonmlewis
Why won't this take a URL like this: /childrens-items/girls and point it to childrens-items-girls?
Code: Select all
RewriteRule ^childrens-items/girls(.*)/? /childrens-items-girls [L,R=301,L]
It's a new site we have taken over, but they have older URLs. Maybe have similar front parts of the URLs, like:
http://www.site.co.uk/childrens-items/g ... en-display
So we want all that are childrens-items/girls/*** to go to childrens-items-girls, and the same for the boys one.
Whole of it:
Code: Select all
DirectoryIndex index.html index.htm index.php
order allow,deny
allow from all
RewriteEngine On
Options +FollowSymLinks
Options +Indexes
RewriteRule ^(blog)($|/) - [L]
RewriteRule ^childrens-items/girls(.*)/? /childrens-items-girls [L,R=301,L]
RewriteRule ^categ/([0-9]+)/([^/]+) /index.php?page=categ&c=$1&cname=$2 [QSA]
RewriteRule ^categ/([0-9]+) /index.php?page=categ&c=$1 [QSA]
RewriteRule ^categ/page/([0-9]+)/([^/]+)/([0-9]+) /index.php?page=categ&c=$1&cname=$2&pagenum=$3 [L]
RewriteRule ^product/([0-9]+)/([^/]+)/([^/]+)/([^/]+) /index.php?page=product&c=$1&category=$2&id=$3&h=$4 [QSA]
RewriteRule ^productsall/([0-9]+)/ /index.php?page=productsall&pagenum=$1/ [L]
RewriteRule ^([^/\.]+)/?$ index.php?page=$1 [L]
RewriteRule ^$ index.php?page=home [L]
Re: HTACCESS - how do you point to another URL with /?
Posted: Tue Feb 10, 2015 9:11 am
by Celauran
simonmlewis wrote:Why won't this take a URL like this: /childrens-items/girls and point it to childrens-items-girls?
Code: Select all
RewriteRule ^childrens-items/girls(.*)/? /childrens-items-girls [L,R=301,L]
Duplicated L notwithstanding -- and get rid of R=301 until you get the rewrite working -- it absolutely should. What's happening?
Re: HTACCESS - how do you point to another URL with /?
Posted: Tue Feb 10, 2015 9:16 am
by simonmlewis
Goodness me, I wish sometimes I cleared cache and site prefs in firefox. It works now!! lol.
Re: HTACCESS - how do you point to another URL with /?
Posted: Tue Feb 10, 2015 9:28 am
by Celauran
I use
Firefox Developer Edition set to delete cache, history, cookies, etc on close. Basically always runs in private mode and I use it only for development. Never need to worry about caches not clearing.
Re: HTACCESS - how do you point to another URL with /?
Posted: Tue Feb 10, 2015 9:35 am
by simonmlewis
Thanks a lot. Now installing that.