Welcome to WebmasterWorld Guest from 23.23.46.20

Forum Moderators: Ocean10000 & incrediBILL & phranque

Mod Rewrite

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

5+ Year Member



Hello,

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)

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



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)

5+ Year Member



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)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



Not the URL you want to use. The URL you actually do use. Most likely
example.com/index.php

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)

5+ Year Member



1. Index remain
2. index.php, i tried also with it, it doesn't work.
9:24 pm on Sep 12, 2013 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



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?
 

Featured Threads

Hot Threads This Week

Hot Threads This Month