Dynadot Aftermarket: discover domain gems worth investing in. Visit our aftermarket.

Mod_rewrite problem

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
SpaceshipSpaceship
Watch

moondog

Established Member
Impact
23
Trying to get the basics of mod_rewrite going. . . I'd like to rename any urls in this format:

index.php?a=c

to this:

index-X.html

where X is the value of 'c'.

Here is what I have:

RewriteEngine on
RewriteBase /
RewriteRule ^index\-(.*)\.html$ index.php?a=$1 [L]


Yet it is not working.. anybody see anything wrong with this?

-Bob
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
I dont think you can do that, it has to be after the file name. of course i could be wrong.

You could make it like

index.html/c/or just www.mysite.com/c/
 
0
Close
Try it without commenting out the - and .
Code:
RewriteEngine on
RewriteBase /
RewriteRule ^index-(.*).html$ index.php?a=$1 [L]
Also if you want the value of c to be case insensitive add ,NC after the L
Code:
RewriteEngine on
RewriteBase /
RewriteRule ^index-(.*).html$ index.php?a=$1 [L,NC]
 
0
Close
B33R said:
Try it without commenting out the - and .

Still not working :(

-Bob
 
0
Close
It's working fine for me. What is the problem exactly?

 
1
Close
I figured it out.. It was me being dense, yet again ;)

-bob
 
0
Close
DomainEasy: flexible LTO options. Close more domain deals with financing.

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