![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Industry Role:
Join Date: Jan 2012
Location: NC
Posts: 7,683
|
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 RewriteRule ^item/([0-9]+)$ item.php?id=$1 [L] 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.
__________________
SSD Cloud Server, VPS Server, Simple Cloud Hosting | DigitalOcean
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Natalie K
Industry Role:
Join Date: Apr 2010
Location: Spain
Posts: 19,403
|
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 ![]()
__________________
My official site ![]() ![]() ![]() Skype: GspotProductions - "Converting traffic into income since 2005" |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Bollocks
Industry Role:
Join Date: Jun 2007
Location: Bollocks
Posts: 2,793
|
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.
__________________
Interserver unmanaged AMD Ryzen servers from $73.00 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 | |
Natalie K
Industry Role:
Join Date: Apr 2010
Location: Spain
Posts: 19,403
|
Quote:
if it´s not possible, then the simple index.php and redirect is an easy option though ![]()
__________________
My official site ![]() ![]() ![]() Skype: GspotProductions - "Converting traffic into income since 2005" |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 | |
Confirmed User
Industry Role:
Join Date: Aug 2006
Location: Poland
Posts: 9,228
|
Quote:
Try disabling this, you probably have it on.
__________________
Mechanical Bunny Media Mechbunny Tube Script | Mechbunny Webcam Aggregator Script | Custom Web Development |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 | |
Confirmed User
Industry Role:
Join Date: Jan 2012
Location: NC
Posts: 7,683
|
Quote:
Code:
Options -MultiViews RewriteEngine On RewriteBase / RewriteRule ^item/([0-9]+)$ item.php?id=$1 [L]
__________________
SSD Cloud Server, VPS Server, Simple Cloud Hosting | DigitalOcean
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Confirmed User
Industry Role:
Join Date: Apr 2010
Posts: 1,101
|
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
__________________
php, html, jquery, javascript, wordpress - contact me at contact at zerovic.com |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 | |
Confirmed User
Industry Role:
Join Date: Jan 2012
Location: NC
Posts: 7,683
|
Quote:
Thank you.
__________________
SSD Cloud Server, VPS Server, Simple Cloud Hosting | DigitalOcean
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
StraightBro
Industry Role:
Join Date: Aug 2003
Location: Monarch Beach, CA USA
Posts: 56,229
|
↑↑↑ Awesome!
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |