-
Mod Rewrite Help
Ok, so I can't get this mod rewrite working correctly.
I'm trying to get this this url:
www.mydomain.com/dir1/goto.php?section=xxxxx
to turn into:
www.mydomain.com/goto/section/xxxxx/ or www.mydomain.com/dir1/goto/section/xxxxx/
I got this code in my .htaccess file in my root dir:
Options +FollowSymLinks
RewriteEngine on
RewriteRule goto/(.*)/(.*)/$ /dir1/goto.php?$1=$2
That almost does what I want correctly, I get the correct page, but it doesn't change the links on the page to the right path. Example, a link on the page shows http://www.mydomain.com/goto/section...dir2/index.php where it should show www.mydomain.com/dir1/dir2/index.php
Ugh.
Jimmy
-
IMHO thats not a mod_rewrite problem but a "coding problem" within the software you are using - mod_rewrite does not change the url but maps an url to the actual one being.
so in order to make happen what you want you need to change the urls being outputtet by your software
hope thats correct & helps
DEVELISH
-
No, I think its a problem with the rewrite code.
The links in the php file are correct and have index.php. The rewrite code is changing the base dir to the faked one. So the link with index.php is being added onto the fake dir link.
Jimmy
-
Are the links outputted by your script as they should look like after a mod_rewrite?
im my .htaccess I do something similar
#RewriteRule ^directory/(.*)/(.*)\.html$ show.html?id=$1 [NC,L,QSA]
this maps the URL http://www.domain.com/directory/Keyword1/Keyword2.html to http://www.domain.com/show.html?id=Keyword1 (keyword2 I do omit)
However my script must produce a link like http://www.domain.com/directory/twinks/rimming.html in order for mod_rewrite to function correctly.
DEV...
-
Thanks, that helped me figure it out!
Jimmy
-
You are very welcome, Jimmy
DEVELISH