RewriteEngine on RewriteBase / RewriteRule ^page/(.*) ?page=$1 [R]
Which results with:
Quote
Input: localhost/page/calendar
Output: localhost/?page=calendar
Output: localhost/?page=calendar
I do have the following code that semi-does what I need it to do:
RewriteEngine on
RewriteBase /
RewriteCond %{QUERY_STRING} page=(.*)$
RewriteRule (.*) /%1? [NC,L,R=301]
Which results with:
Quote
Input: localhost/?page=calendar
Output: localhost/calendar
Output: localhost/calendar
Which is what I want, but instead of going to "index.php" in the root folder, I assuming it's handling the "/calendar" as a sub-directory rather than a variable, so I get a nasty 404 error.
If I place "index.php" in the rewrite rule before the /%1? like this:
RewriteRule (.*) index.php/%1? [NC,L,R=301]
It gives this:
Quote
localhost/index.php/calendar
Which works slightly, except for styles and images don't work again other than on the main page, but I am able to get what I need from the URL in regards to variables by using this code:
$url = explode("/", $_SERVER['REQUEST_URI']);
echo $url[2]; // used to be $url[1] but since the "index.php" is there I had to change it to "2"
The above code will print 'calendar' and in itself it "functions" properly, but has the ill effects on my styles and images.
I've been at this for days and it's driving me up the wall. Can anyone please help me out? Thanks in advance.

New Topic/Question
Reply



MultiQuote





|