Jump to content

Basic Rewrite -- Issues...


shanejeffery86

Recommended Posts

I have been doing mod_rewrite for a bit now and heck if I can figure out what is going wrong. 

 

I am just trying to rewrite 3 VERY basic URLs.

 

http://www.khaccounts.net/index.php -- to -- http://www.khaccounts.net/buy-wow-account/

http://www.khaccounts.net/sell.php -- to -- http://www.khaccounts.net/sell-wow-account/

http://www.khaccounts.net/about.php -- to -- http://www.khaccounts.net/about-khaccountsnet/

 

I was under the impression that the following would work:

 

RewriteEngine On

RewriteRule /buy-wow-account/ /index.php [L]

RewriteRule /sell-wow-account/ /sell.php [L]

RewriteRule /about-khaccountsnet/ /about.php [L]

 

What am I doing wrong?  The mod_rewrite module is enabled at the server level.

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/215008-basic-rewrite-issues/
Share on other sites

Where are you placing the directives? Assuming it's in a .htaccess file then you probably want to lose the forward slash at the start of the pattern.

 

RewriteEngine On
RewriteRule ^buy-wow-account/?$ /index.php [L]
RewriteRule ^sell-wow-account/?$ /sell.php [L]
RewriteRule ^about-khaccountsnet/?$ /about.php [L]

Archived

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

×
×
  • Create New...

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.