![]() |
strange .htaccess issue
i am trying to rewrite urls on WAMP using .htaccess
i want this Code:
www.example.com/item/1234 Code:
www.example.com/item.php?id=1234 Code:
RewriteEngine On this Code:
<link rel="stylesheet" href="css/style.css"> Code:
<link rel="stylesheet" href="item/css/style.css"> i have used same config in nginx and it used to work fine on lemp. but on wamp its screwing all the relative links. what is wrong ? i know i can define base url in html, but i want to know what is messing this and why now ? is it wamp ? Thanks for your time. |
If correct, you´re trying to make sure your concealing the directory "item" by opening page item.php...
why not just add page index.php in this directory, thus it always opens when going to this directory & here you can just redirect index.php to item.php :thumbsup |
Because he probably doesn't want query strings in his URLs, doesn't want to have to physically create the directory and doesn't want to redirect the browser at all? :)
But i don't know anything about using htaccess on WAMP so I can't help. I wouldn't be surprised if the regex is totally different to Linux. |
Quote:
if it´s not possible, then the simple index.php and redirect is an easy option though :2 cents: |
Quote:
Try disabling this, you probably have it on. |
Quote:
Code:
Options -MultiViews |
Hey man,
simply change the way you include your css file instead of using this <link rel="stylesheet" href="css/style.css"> add it like this, with a leading slash <link rel="stylesheet" href="/css/style.css"> if you use it without the leading slash, it will use the current url displayed in the browser.. if you add the leading slash, it will use the root domain if you still have troubles with it, add this to your .htaccess before the RewriteEngine On command RewriteRule ^css - [L,NC] this will completely ignore the css directory from any rewrite rule ps. tested it, it works if you can't make it work, feel free to contact me cheers, z |
Quote:
Thank you. |
↑↑↑ Awesome! :banana
|
All times are GMT -7. The time now is 05:53 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123