Jump to content


Photo

Is this rewrite rule possible?


  • Please log in to reply
3 replies to this topic

#1 AdRock

AdRock
  • Members
  • PipPipPip
  • Advanced Member
  • 911 posts

Posted 04 September 2006 - 09:09 PM

Can you rewrite a rule so you get something like

www.mysite.com/somepage/1

from this

www.mysite.com/index.php?page=something_1

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

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

but i don't know if this is right
If your topic has been solved, please mark the topic as SOLVED.

This helps others from identifying which topics need help still

#2 oldmanice

oldmanice
  • Members
  • PipPipPip
  • Advanced Member
  • 134 posts
  • LocationIn Your Garden At Night

Posted 04 September 2006 - 09:24 PM

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.
Join my Froums www.phpbbplanet.com/darkwinter

#3 AdRock

AdRock
  • Members
  • PipPipPip
  • Advanced Member
  • 911 posts

Posted 04 September 2006 - 09:39 PM

This is my current .htaccess file

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]

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

If your topic has been solved, please mark the topic as SOLVED.

This helps others from identifying which topics need help still

#4 oldmanice

oldmanice
  • Members
  • PipPipPip
  • Advanced Member
  • 134 posts
  • LocationIn Your Garden At Night

Posted 04 September 2006 - 09:42 PM

Um sorry I have know idea
Join my Froums www.phpbbplanet.com/darkwinter




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users