Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Help with mod_rewrite
Old 04-13-2009, 05:10 PM Help with mod_rewrite
Junior Talker

Posts: 2
Trades: 0
I´m in the process of transferring my pages from html to php.
For SEO, I would like to move all the pages ending with -en.php to a subdirectory /English/ and all those ending with -fr.php to /French/.

I would also need to redirect the old html pages to the new ones.

I tried RewriteRule ^English/(.*?)-en.php$ /home-en.php and the pages seem to be located under /English/ but all the pages are there, not just the ones ending with -en.php.

I can´t work out what the code should be like.
redapple is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-17-2009, 08:56 AM Re: Help with mod_rewrite
nayes84's Avatar
Extreme Talker

Latest Blog Post:
Difference between ASP And JSP
Posts: 232
Name: John
Location: Tokyo
Trades: 0
you need to escape special characters in your pattern
RewriteRule ^English/(.*?)-en\.php$ /home-en.php

besides you need to specify which page was clicked in the target url

I think it would be
RewriteRule ^English/(.*?)-en\.php$ /$1-en.php
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

if(I'm("Helpful")) Add_Talkupation("nayes84");

Last edited by nayes84; 04-17-2009 at 08:58 AM..
nayes84 is offline
Reply With Quote
View Public Profile
 
Old 04-17-2009, 01:29 PM Re: Help with mod_rewrite
Junior Talker

Posts: 2
Trades: 0
Thanks for your answer, nayes84. I tried the code you suggested but still it moves all the pages in that subdirectory, not just those with -en.php. I tried also to put an escape character in front of the dot in $1-en\.php but it made no difference.
redapple is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Help with mod_rewrite
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.12132 seconds with 12 queries