Jump to content

Problem with rewrite - please need your advise


saariko

Recommended Posts

Hi,

 

I am trying to rewrite from: http://www.domain.com/a/VALUE 

to

http://www.domain.com/a/p.php?id=VALUE

 

I have tried the following, but nothing works

  RewriteBase /
  Rewritecond %{REQUEST_URI} !(^/a/*$) [NC]
  RewriteRule a/([0-9]+) /a/p.php?id=$1 [L]

 

  RewriteBase /
  RewriteRule ^a/(.*)$ a/p.php?id=$1 [R=301,L]

 

 RewriteCond %{HTTP_HOST} ^domain.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301]
RewriteRule ^a/([A-Za-z0-9-]+)?$ a/p.php?id=$1 [NC]

 

 

My .htaccess is in my http root folder, do I need to move it to my /a/ directory? and change the rules?

 

If I try to play with the rules, and lets say do a redirect to : www.cnn.com  it works, but I really need to rewrite for it to work.

 

Thank you very much.

 

 

 

 

 

 

 

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.