Jump to content

mod-rewrite has no effect


wright67uk

Recommended Posts

I'm using an .htaccess file but it has no effect.  I'm using godaddy for my hosting.

 

#mod_rewrite
#RewriteBase /
 
#Fix Rewrite
Options -Multiviews
 
RewriteEngine on
RewriteBase /
Options +FollowSymLinks
 
RewriteRule ^C_(.*)$ cat.php?type=$1 [L]
RewriteRule ^P_(.*)$ product_info.php?name=$1 [L]
 
Im trying to make it so if anyone were for an example to click on a link:  
 
1pw.co.uk/product_info.php?name=namehere
 
it would display in the browser as
 
1pw.co.uk/P_namehere
 
at the moment everything is as it were before i even added the file.  Where am i going wrong?
Link to comment
Share on other sites

Ok thankyou, I understand how this works now.

Can I change this so that instead of

http://www.1pw.co.uk/C_Shrubs

I can have

http://www.1pw.co.uk/shrubs

 

And instead of

http://www.1pw.co.uk/P_AMELANCHIER%20CANADENSIS

I can have

http://www.1pw.co.uk/amalanchier_canadensis

?

Thanks for your help on this :-)

Edited by wright67uk
Link to comment
Share on other sites

Yes you can but then mod rewrite will not know which rewriterule will apply to those urls (for example it will not know that /shrubs should go to the rewriterule for cat.php or /amalanchier_canadensis should go to the rewriterule for product_info.php).

 

It currently only knows which rewriterule applies due to the the  C_ and P_ prefixes. If you don't like the C_ and P_ prefixes then maybe change your urls to something like

site.com/category/shrubs

site.com/product/amalanchier_canadensis

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.