0

I've a problem with my .htaccess to use friendly url in my website.

My server structure is:

  1. www:
    • test-web (website test code).
      • shop-test.
        • .htaccess
        • others files to my shop website (index, images, etc...)

My .htaccess have the next code to redirect the url

<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteEngine on
RewriteBase /test-web/shop-test    
RewriteRule ^pay$ index.php?section=buy [L]
RewriteRule ^details/(.+)/?$ index.php?section=details&item=$1 [L]
</IfModule>

But if I write my url like the next example, doesn't work:

<a href='/test-web/shop-test/pay'>go to pay<a>

I tried to write others links like "/shop-test/pay", just put "pay" in my link and change the RewriteBase in my .htaccess to "/shop-test" or "/test-web" and anything works.

What is my mistake?

Marcos
  • 241
  • 5
  • 13
  • Do you actually have anything in `test-web`? seems like unnecessary dir. – Panama Jack Feb 18 '16 at 15:35
  • Yes, I have there a test website (it a wordpress site) – Marcos Feb 18 '16 at 15:40
  • 1
    ok, well your rewritebase and rewriteengine are in the wrong order btw. They need to come first before any other Rewrite directives. Also take a took at Jon's explanation of using rewritebase with subsubdir's. It should get you going. http://stackoverflow.com/questions/21347768/what-does-rewritebase-do-and-how-to-use-it/21348047#21348047 – Panama Jack Feb 18 '16 at 15:54

0 Answers0