Jump to content

Archived

This topic is now archived and is closed to further replies.

AdRock

Is this rewrite rule possible?

Recommended Posts

Can you rewrite a rule so you get something like

[url=http://www.mysite.com/somepage/1]www.mysite.com/somepage/1[/url]

from this

[url=http://www.mysite.com/index.php?page=something_1]www.mysite.com/index.php?page=something_1[/url]

I have about four pages named something_1, something_2 etc and don't know if i need a rewrite rule for each page
I was thinking of something like

[code]RewriteRule ^somepage/([0-9]+)/?$ index.php?page=something_$1[/code]

but i don't know if this is right

Share this post


Link to post
Share on other sites
I think the reason you are getting ? and = is because you have either left gaps in your files or you need to make a vhost. If you have no gaps in your files that could fix the url.

Share this post


Link to post
Share on other sites
This is my current .htaccess file

[code]Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteRule ^([A-Za-z0-9\-_]+)/?$ index.php?page=$1
RewriteRule ^gallery/([A-Za-z0-9\-_]+)/([0-9]+)/?$ index.php?page=$1&id=$2
RewriteRule ^([A-Za-z0-9]+)/([0-9\-_]+)/?$ index.php?page=$1&pagenum=$2
RewriteRule ^admin/([A-Za-z0-9\-_]+)/?$ admin/index.php?page=$1 [L] [/code]

which works fine.  I can change index.php?page= to just the pagename

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.