homepage Welcome to WebmasterWorld Guest from 54.166.228.100
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / WordPress
Forum Library, Charter, Moderators: lorax & rogerd

WordPress Forum

    
Permalink structures prefixed with /index.php/
paparoysan




msg:4549059
 5:50 pm on Feb 26, 2013 (gmt 0)

i have old wp blog (about 600 posts) with url mysite.com/blog/

The premalink structure is mysite.com/blog/index.php/post-name/

I would like to use wp to run my whole site, so I tried to move its home page to the root: mysite.com

in this process something went wrong and it lost /index.php/ in its structure.

i would like to preserve the same permalink structure for blog posts (mysite.com/blog/index.php/post-name/ ) and keep pages structure as : mysite.com/page-name/

is it possible?

Thank you in advance for your time and effort.

 

phranque




msg:4549321
 4:39 am on Feb 27, 2013 (gmt 0)

you probably want to be using the pathinfo style permalinks.

lorax




msg:4549426
 1:54 pm on Feb 27, 2013 (gmt 0)

You might be able to but the level of effort to make it happen and the hassle it's going to cause each time WP comes out with an update just isn't worth the effort in my opinion. You'd be better served just going without index.php in the URL structure.

Moriarty




msg:4549464
 3:05 pm on Feb 27, 2013 (gmt 0)

I have the opposite problem - I want rid of the /blog/index.php structure.

My .htaccess file looks like this:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
</IfModule>
# END WordPress

How does this compare to yours, and can you enlighten me on what I am doing wrong ;-) ?

@Phranque - could you elucidate on the use of pathinfo style permalinks? Your response is rather vague. M

paparoysan




msg:4549472
 3:16 pm on Feb 27, 2013 (gmt 0)

lorax, thank you - i am not sure what to do re seo as all 600 post would need to change url :/

moriarty - my .htacces at the moment (/blog/index.php/ ) looks like this:

# 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

lorax




msg:4549501
 4:42 pm on Feb 27, 2013 (gmt 0)

Your SEO may take a hit for a bit but I think it would be shortlived especially if you use a 301 redirect.

Moriarty




msg:4549504
 4:47 pm on Feb 27, 2013 (gmt 0)

Paparoysan

I think you may find changing

RewriteRule . /blog/index.php [L]

to

RewriteRule . /index.php [L]

will help. Because that is what I had when I got my /blog/ which you seem to want. In changing it to what it should be (RewriteRule . index.php [L] ), I still have the /blog/ and I don't understand!

paparoysan




msg:4550625
 11:10 am on Mar 3, 2013 (gmt 0)

thx for suggestions - i will leave it for a moment as it is and wait for slower period to change the link structure (to be on the safe side)

lucy24




msg:4550630
 12:13 pm on Mar 3, 2013 (gmt 0)

In changing it to what it should be (RewriteRule . index.php [L] ), I still have the /blog/ and I don't understand!

Do you have a RewriteBase directive somewhere? There are so many quoted htaccesses flying around this thread, I can't keep track.

btw, it should never be "index.php" like that. Always include a leading slash; don't rely on your RewriteBase to fix it for you.

g1smd




msg:4550647
 1:43 pm on Mar 3, 2013 (gmt 0)

The IfModule container tags are not needed.

Moriarty




msg:4550695
 5:50 pm on Mar 3, 2013 (gmt 0)

Thanks all, for your insights.

I have added the slash as you suggested, however it has not resolved my problem.

The .htaccess in my case is the one I quoted in my former comment - save that it is now updated to include your suggestion.

Has anyone any suggestions as to how to restore the permalink structure of my choice without /blog/. I have had this problem since my last upgrade.

lucy24




msg:4550749
 11:35 pm on Mar 3, 2013 (gmt 0)

Oops, just realized this is the WordPress forum, not the Apache forum. (Byproduct of using the "Recent Posts" option.) That means there are two different sets of questions.

One question is about format of links created by the WP software itself. That's a WP question.

The other question is about where to send people when they ask for a particular URL. That's an Apache question.

Moriarty




msg:4550840
 8:49 am on Mar 4, 2013 (gmt 0)

Lucy24

"The other question is about where to send people when they ask for a particular URL. That's an Apache question. "

Is there any more help you can offer, or should I learn how to post questions in the Apache forum first - when I didn't know that it was an Apache question?

lucy24




msg:4550871
 10:28 am on Mar 4, 2013 (gmt 0)

Whoops! I wasn't trying to stomp on you, just disentangling the question. Right now I can't tell whether you're asking one question or the other or both.

If your WordPress software is sending people to a particular location, and you have to redirect them, then anything involving htaccess is a bandaid solution. The real solution is fiddling with WordPress so it doesn't send people to the wrong place.

Note that this applies only to redirecting: the URL that they see in their browser's address bar. It doesn't apply to rewriting: stuff you do secretly behind the scenes. (Or that WordPress does secretly.)

Moriarty




msg:4550890
 11:56 am on Mar 4, 2013 (gmt 0)

Lucy, the reason I was using the .htaccess path was because in my admin panel I have no recourse to use custom links - everything in my permalinks settings in this format -

Default [examplesite.com...]
Day and name [examplesite.com...]
Month and name [examplesite.com...]
Numeric [examplesite.com...]
Post name [examplesite.com...]
Custom Structure [examplesite.com...]

I was told that the .htaccess was the way to go. Whatever happened, I am looking for some kind of solution.

I can easily understand your point about the .htaccess file being a patch, only this sort of thing isn't always clear to someone who is new to the ideas behind Apache. It has been an informative experience - only as with all things code, extremely frustrating as nothing is logical. Or better said, the reasoning behind the code is always different (thus appears illogical).

[edited by: lorax at 11:35 pm (utc) on Mar 4, 2013]
[edit reason] removed specifics [/edit]

g1smd




msg:4550918
 1:23 pm on Mar 4, 2013 (gmt 0)

The site should link to the URLs you want users to see and use. URLs are defined in links.

htaccess cannot "make" URLs. This part of the solution needs changes to the Wordpress configuration and code.

You then need a RewriteRule configured as a rewrite to connect the URL request after a link is clicked with the internal filepath where the content really resides.

You also need a RewriteRule configured as a redirect so that users asking for the old URL when clicking stale searchengine listings or bookmarks are redirected to the new URL.

Moriarty




msg:4550962
 4:48 pm on Mar 4, 2013 (gmt 0)

Thankyou for your response. Could you elucidate on your comment that "This part of the solution needs changes to the Wordpress configuration and code."

Where precisely do I make these rewriterules, how do I make them - and why did they go wrong with an update, for goodness' sake!

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / WordPress
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved