Mod rewrite help needed

SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
Watch
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
This would be difficult with mod_rewrite since you don't have a 1 to 1 mapping between the original and rewritten URLs. You might need to use a PHP script instead of (or in conjunction with) mod_rewrite to do the mapping (e.g. from category-name to id)
 
0
Close
0
Close
If you can modify the category.php and vide.php scripts to take a category name or a title instead of an id, then you might try the following:

Code:
RewriteEngine on

RewriteRule ^category/([^/]+)/page([0-9]+)$  category.php?name=$1&page=$2 [L]
RewriteRule ^view/([^/]+)$ view.php?title=$1 [L]
 
0
Close
Thanks dude. I will let you know the outcome of it.
 
0
Close
0
Close
If you can modify the category.php and vide.php scripts to take a category name or a title instead of an id, then you might try the following:

Code:
RewriteEngine on

RewriteRule ^category/([^/]+)/page([0-9]+)$  category.php?name=$1&page=$2 [L]
RewriteRule ^view/([^/]+)$ view.php?title=$1 [L]

The view one worked, but the category one did not work. It says page not found.
 
0
Close
0
Close
Okay, it works now. But it bugs out if I don't have /page1. Can I have it default to being page1 if a page isn't inputted?
 
0
Close
Add another rule:

Code:
RewriteRule ^category/([^/]+)$  category.php?name=$1&page=1 [L]
 
0
Close
Appraise.net

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back