Friday 15 June 2012

.htaccess passing domain name -


I am trying to rewrite the path in .htaccess

= - = - = - = - = - Edit = - = - =

Hello, I have not expressed your problem clearly. So this is a lively example of my problem.

  "http://fames.in/site/bollywoodhungama.com" - works fine "http://fames.in/site/bollywoodhungama.com/2" - error < / Code> 

The format of the URL is:

  http://fames.in/site/ (site name) / (page number)  < / Pre> 

I use the following code in .htaccess

  rewrite ^ site /(.*)$ sitelist.php? Q = $ 1 & amp; Page = 1 rewrite rule site / (. *) / ([0- 9] +) $ sitelist.php? Q = $ 1 and page = $ 2  

The first row works fine in the second line of code, passing the whole parameter 'Q' with HTX. Taking up the URL, it has been passed as "/sitelist.php?q=bollywoodhungama.com//2". I need to pass 'q' and 'page' separately like "/sitelist.php?q=bollywoodhungama.com&page=2"

The problem is that the first rule is always matched *. * Greedy is therefore part of the match / 2. The changes you need are similar to 'anything but slash':

  rewrite rules / site ([^ /] *) $ sitelist.php? Q = $ 1 and page = 1  

Then the second domain will fail in the match, and then match the second rule.

If you need more rules when this rule is implemented, but you want to add '' [L] to your end rule


No comments:

Post a Comment