Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Website and Server Administration Forum


You are currently viewing our Website and Server Administration Forum as a guest. Please register to participate.
Login



Reply
another mod rewrite question
Old 01-30-2012, 10:42 AM another mod rewrite question
Skilled Talker

Posts: 69
Name: Greg
Location: South Carolina
Trades: 0
trying to educate myself here. I know there is a way to rewrite a url so that if it contains the following

website.com/index.php?page=locations

it would just turn it into

website.com/locations

This would work for anything that has the pattern index.php?page= correct? Any help with what the flags etc are? I have tried the below among many other things and can not get it to work

RewriteCond %{QUERY_STRING} index.php?page=
RewriteRule (.*) website.com/$1? [R=301]
scuts is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-01-2012, 11:45 PM Re: another mod rewrite question
vivekar's Avatar
Webmaster Talker

Posts: 612
Trades: 0
This will work
Code:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^/([a-zA-Z0-9-]*)
RewriteRule ^(.*) /index.php?page=%1	[L]
so... www.yourdomain.com/anything-here
will show the content from index.php?page=anything-here

for more details check out this guide at Apache website
URL Rewriting Guide
__________________

Please login or register to view this content. Registration is FREE
(Active since 2003) |
Please login or register to view this content. Registration is FREE
vivekar is offline
Reply With Quote
View Public Profile Visit vivekar's homepage!
 
Reply     « Reply to another mod rewrite question
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.45723 seconds with 12 queries