Hello everyone, I was wondering if anybody could give me something that I could write in the .htaccess file on my server to get it to rewrite the URL from this:
http://************.com/?pageName=FourthPage
To this:
http://global7voices....com/FourthPage
Whilst retaining the GET request variables and information?
I've been researching and researching, and nothing seems to work, I don't know if it's anything to do with the fact that the server is using LiteSpeed instead of Apache, but if any of you guys have any ideas on how to get this to work, that would be incredibly helpful.
Thanks a lot guys.
MOD_REWRITE for rewriting GET requests
Page 1 of 12 Replies - 1473 Views - Last Post: 06 March 2012 - 01:37 AM
Replies To: MOD_REWRITE for rewriting GET requests
#2
Re: MOD_REWRITE for rewriting GET requests
Posted 02 March 2012 - 06:31 AM
Have you had a quick go at trying this, it should be extremely easy...
This is untested but should help get you started, index.php will be what ever page accepts your $_GET['pageName'] variable.
You could also do.
Then you could have www.example.com/page/FourthPage.
RewriteCond %{REQUEST_fileNAME} !-d
RewriteCond %{REQUEST_fileNAME} !-f
RewriteRule ^([^/\.]+)/?$ index.php?pageName=$1
This is untested but should help get you started, index.php will be what ever page accepts your $_GET['pageName'] variable.
You could also do.
RewriteRule ^page/([^/\.]+)/?$ index.php?pageName=$1
Then you could have www.example.com/page/FourthPage.
#3
Re: MOD_REWRITE for rewriting GET requests
Posted 06 March 2012 - 01:37 AM
Thanks dude, that helped a lot. I had another way implemented, but it wasn't so good for accessing real directories. Made my day 
I've never really used .htaccess for this purpose before, that's why I needed the help, thank you!
I've never really used .htaccess for this purpose before, that's why I needed the help, thank you!
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote



|