Is anyone half decent with .htaccess?
Moderator: Staff
- dr-spangle
- Technical Advisor
- Posts: 13072
- Joined: Wed May 30, 2007 12:20 pm
- Contact:
Is anyone half decent with .htaccess?
Having a bit of a problem with mine
This should redirect "index.php?L=3" to "includes/page.php?index.php&L=3" however it goes to "includes/page.php?index.php&L="
Does anyone know why?
I ran it through a regex tool online ( http://www.regexplanet.com/simple/index.jsp ) and it produced the result I wanted...
Code: Select all
RewriteEngine On
# RewriteRule ^$ includes/page.php?P=index.php
RewriteRule ^([^/\r\n\?]*)(\?L=([0-9]*)|)$ includes/page.php?P=$1&L=$3
Does anyone know why?
I ran it through a regex tool online ( http://www.regexplanet.com/simple/index.jsp ) and it produced the result I wanted...
- pawelabrams
- Posts: 3207
- Joined: Sun Jun 24, 2007 8:14 pm
- Location: Novograd, Interland
- Contact:
Re: Is anyone half decent with .htaccess?
Should that be $3 or $2?
Pavel' Abramovic:, the President of Interland
IRL just a random guy from Poland. Still learning English.
IRL just a random guy from Poland. Still learning English.
- dr-spangle
- Technical Advisor
- Posts: 13072
- Joined: Wed May 30, 2007 12:20 pm
- Contact:
- pawelabrams
- Posts: 3207
- Joined: Sun Jun 24, 2007 8:14 pm
- Location: Novograd, Interland
- Contact:
Re: Is anyone half decent with .htaccess?
Could be...
And what's that "|" after ([0-9]*)?
And what's that "|" after ([0-9]*)?
Pavel' Abramovic:, the President of Interland
IRL just a random guy from Poland. Still learning English.
IRL just a random guy from Poland. Still learning English.
- dr-spangle
- Technical Advisor
- Posts: 13072
- Joined: Wed May 30, 2007 12:20 pm
- Contact:
- pawelabrams
- Posts: 3207
- Joined: Sun Jun 24, 2007 8:14 pm
- Location: Novograd, Interland
- Contact:
Re: Is anyone half decent with .htaccess?
index.php?L=3|
Try that address - if it works, I have a solution.
Try that address - if it works, I have a solution.
Pavel' Abramovic:, the President of Interland
IRL just a random guy from Poland. Still learning English.
IRL just a random guy from Poland. Still learning English.
- dr-spangle
- Technical Advisor
- Posts: 13072
- Joined: Wed May 30, 2007 12:20 pm
- Contact:
- pawelabrams
- Posts: 3207
- Joined: Sun Jun 24, 2007 8:14 pm
- Location: Novograd, Interland
- Contact:
Re: Is anyone half decent with .htaccess?
Meh, I'll have to do similar thing on my server...
Pavel' Abramovic:, the President of Interland
IRL just a random guy from Poland. Still learning English.
IRL just a random guy from Poland. Still learning English.