3
Contributors
5
Replies
6
Views
6 Years
Discussion Span
Last Post by somedude3488
0

I have searched this forum and have done extensive google search and have not been able to figure it out. I have many links that look like:

http://www.mysite.com/example6.php?id=play-game
http://www.mysite.com/example6.php?id=watch-tv
http://www.mysite.com/example6.php?id=go-outside

I have tried lots of different code putting this in my .htaccess file:

Options +FollowSymLinks
Options +Indexes
RewriteEngine On
RewriteRule ^([^/]*)\.html$ /example6.php?id=$1 [L]

and

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^id/(.*) example6.php?id=$1
</IfModule>

and many more attempts but nothing works to get my URLS to look like this:

http://www.mysite.com/example6/play-game
http://www.mysite.com/example6/watch-tv
http://www.mysite.com/example6/go-outside

I do have mod_rewrite enabled on my server. Does anyone have any ideas? Thanks in advance.

0
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^example6/([^/]+)$ example6.php?id=$1 [L]

Does that work? Haven't tested it so I might of forgotten something. Just wrote it from memory.

0

No, I have also tried

RewriteRule ^(.*?)/(.*) example6.php?id=$1&id2=$2

and

RewriteRule ^example6/(.*)$ /example6.php?id=$1 [L]

Does it matter where I upload my .htaccess file to? Thanks much

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.