homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

Mod Rewrite

 8:13 pm on Aug 13, 2013 (gmt 0)


I'm using a script which have a crypted index.php file in the domain root and which "include" to the script template /script/tube/index.php

There are already a htaccess created with some mod_rewrite like:

RewriteRule ^models/$ /script/tube/?force_template=model_list [L]

I would like /script/tube/?group_id=2 to be the main page ( ie domain.com )

I tried:

RewriteRule ^$ /script/tube/?group_id=2 [L]

But it doesn't work.

Thanks for your help.



 8:15 pm on Aug 13, 2013 (gmt 0)

What is the URL (with parameters) that you currently use to access that page?

Use example.com in place of the real hostname.


 8:28 pm on Aug 13, 2013 (gmt 0)

domain.com?group_id=2 or domain.com/script/tube/?group_id=2 or domain.com/index.php?group_id=2


 9:19 pm on Aug 13, 2013 (gmt 0)

Not the URL you want to use. The URL you actually do use. Most likely

I tried:

RewriteRule ^$ /script/tube/?group_id=2 [L]

But it doesn't work.

#1 what happens when you try?
#2 what's after /tube/ ? This is a rewrite, not a redirect, so there's no reason to suppress the index.php or whatever it is.


 9:04 pm on Sep 12, 2013 (gmt 0)

1. Index remain
2. index.php, i tried also with it, it doesn't work.


 9:24 pm on Sep 12, 2013 (gmt 0)

For testing purposes, replace [L] alone with [R,L]. This is an easy way to see whether the intended redirect/rewrite is taking place, since your browser's address bar will change. (In rare cases, rules creating a redirect will behave differently from rules creating a rewrite alone. But it shouldn't apply here.)

As noted above, there's no reason to use a final / in a rewrite. Say explicitly /index.php or whatever the extension is. Using / may invite trouble, because now another module, mod_dir, has to get involved before the rule can take effect.

If you change to /index.php, make sure your index-redirect (earlier in the RewriteRule section of htaccess) has a RewriteCond looking at {THE_REQUEST} so you don't get an infinite loop.

Do you have any other htaccess files affecting the same domain? If so, do they include mod_rewrite? In the htaccess we're talking about, do you have any RewriteRules that definitely do work?

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
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