remove index.php in URLs for Worpress
11 posts
• Page 1 of 1
- DesignsOnline
- Posts: 14
- Joined: 27 Apr 2013, 17:11
remove index.php in URLs for Worpress
Currently in Wordpress the URLs are working as follows:
http://mydomain.co.uk/index.php/category/
What im trying to achieve and failing is this:
http://mydomain.co.uk/category.html
Could someone please post a rule to do this?
(Using rewrite v2)
Thank you
http://mydomain.co.uk/index.php/category/
What im trying to achieve and failing is this:
http://mydomain.co.uk/category.html
Could someone please post a rule to do this?
(Using rewrite v2)
Thank you
- DesignsOnline
- Posts: 14
- Joined: 27 Apr 2013, 17:11
Re: remove index.php in URLs for Worpress
Or even just to remove the index.php from the URL would be fine (better in fact)
so the current URL:
http://mydomain.co.uk/index.php/category/
Would become this:
http://mydomain.co.uk/category/
Could someone please post a rule to do this?
(Using rewrite v2)
so the current URL:
http://mydomain.co.uk/index.php/category/
Would become this:
http://mydomain.co.uk/category/
Could someone please post a rule to do this?
(Using rewrite v2)
- DesignsOnline
- Posts: 14
- Joined: 27 Apr 2013, 17:11
Re: remove index.php in URLs for Worpress
im now half way there, ive got the rule to remove the www. from the URL as I wanted, and using the permalinks in wordpress ive got the website structure how I want:
These are my current rules:
However one last problem, my website in Google is indexed using the old structure which still works (http://mydomain.co.uk/index.php/category/) So I need a 301 redirect (or equivalent permanent redirect) to point those URLs to the new urls (ie remove the index.php part) http://mydomain.co.uk/category/ so that I dont get problems with duplicate content.
Could someone please help with this final piece of the puzzle?
Thank you
http://mydomain.co.uk/category/
These are my current rules:
# RULE NAME: Redirect www to non-www
# (http://www.mydomain.co.uk to http://mydomain.co.uk)
[ISAPI_Rewrite]
RewriteCond Host: http://www.mydomain\.co.uk
RewriteRule (.*) http\://mydomain\.co.uk$1 [I,RP]
# clean up page urls
RewriteRule /(?!index\.php)([^.]+?)/? /index.php/$1 [I,L]
However one last problem, my website in Google is indexed using the old structure which still works (http://mydomain.co.uk/index.php/category/) So I need a 301 redirect (or equivalent permanent redirect) to point those URLs to the new urls (ie remove the index.php part) http://mydomain.co.uk/category/ so that I dont get problems with duplicate content.
Could someone please help with this final piece of the puzzle?
Thank you
- DesignsOnline
- Posts: 14
- Joined: 27 Apr 2013, 17:11
Re: remove index.php in URLs for Worpress
That has broken the website, none of the category pages will now load...
- DesignsOnline
- Posts: 14
- Joined: 27 Apr 2013, 17:11
Re: remove index.php in URLs for Worpress
ok ive realised that the problem partly lies with the wordpress permalinks.
To get the site links working, under Permalinks in Wordpress I needed to select custom structure: /index.php/%postname%/
So currently the links on the site are http://mydomain.co.uk/index.php/category/
My goal is still to have the urls working as http://mydomain.co.uk/category/
Does anyone have a working solution for this?
To get the site links working, under Permalinks in Wordpress I needed to select custom structure: /index.php/%postname%/
So currently the links on the site are http://mydomain.co.uk/index.php/category/
My goal is still to have the urls working as http://mydomain.co.uk/category/
Does anyone have a working solution for this?
- HeliconAndrew
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: remove index.php in URLs for Worpress
Here's some help to get a basic ides - http://www.helicontech.com/articles/isa ... wordpress/. It's for ISAPI_Rewrite3 though
Regards
Andrew
Regards
Andrew
- DesignsOnline
- Posts: 14
- Joined: 27 Apr 2013, 17:11
Re: remove index.php in URLs for Worpress
Thanks, I did look at that, but it doesn't provide a way to do what im looking for....
Does anyone have any alternative solutions...?
Does anyone have any alternative solutions...?
- HeliconAndrew
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: remove index.php in URLs for Worpress
I was just saying that the idea is the same: 1. Change WP permalinks to SEO-friendly. 2. Adjust the rules.
The rule you're looking for should look like:
Did I understand correctly that you changed the permalinks to /index.php/category instead of /category/?
The rule you're looking for should look like:
- Code: Select all
a. rewrite SEO-friendly urls to point to index.php
b. redirect old links to a new format without index.php
Did I understand correctly that you changed the permalinks to /index.php/category instead of /category/?
- DesignsOnline
- Posts: 14
- Joined: 27 Apr 2013, 17:11
Re: remove index.php in URLs for Worpress
Yes when I removed index.php from the permalinks, the links on the website didnt work.
So now im back to the website using the following structure:
http://mydomain.co.uk/index.php/category/
im trying to get it to use:
http://mydomain.co.uk/category/
but im not sure how to do it.
So now im back to the website using the following structure:
http://mydomain.co.uk/index.php/category/
im trying to get it to use:
http://mydomain.co.uk/category/
but im not sure how to do it.
- HeliconAndrew
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: remove index.php in URLs for Worpress
There are many cases that you can take a look at here. e.g. http://www.helicontech.com/forum/14820- ... e_2-1.html
Regards
Andrew
Regards
Andrew
11 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 0 guests