Forum Moderators: phranque
I have tried all of the following:
RewriteRule entry/(.+) entry.php?id=$1 [L]
RewriteRule /entry/(.+) /entry.php?id=$1 [L]
RewriteRule ^entry/(.+)$ entry.php?id=$1 [L]
RewriteRule ^/entry/(.+)$ /entry.php?id=$1 [L]
RewriteRule entry/(.*) entry.php?id=$1 [L]
RewriteRule /entry/(.*) /entry.php?id=$1 [L]
RewriteRule ^entry/(.*)$ entry.php?id=$1 [L]
RewriteRule ^/entry/(.*)$ /entry.php?id=$1 [L]
RewriteRule entry/([^/]+) entry.php?id=$1 [L]
RewriteRule /entry/([^/]+) /entry.php?id=$1 [L]
RewriteRule ^entry/([^/]+)$ entry.php?id=$1 [L]
RewriteRule ^/entry/([^/]+)$ /entry.php?id=$1 [L]
RewriteRule entry/([^/]*) entry.php?id=$1 [L]
RewriteRule /entry/([^/]*) /entry.php?id=$1 [L]
RewriteRule ^entry/([^/]*)$ entry.php?id=$1 [L]
RewriteRule ^/entry/([^/]*)$ /entry.php?id=$1 [L]
QSAand
NEin the flags.
I can get:
RewriteRule ^entries.xml$ rss-entries.php [L]
RewriteRule ^page1.html$ page2.php [L]
I have read a number of mod_rewrite threads on these boards and more tutorials on the web than I care to count, but just can't seem to figure this out. What am I doing wrong?
^entry/([a-zA-Z0-9_]+)$ /entry.php?id=$1
I have some code as part of entry.php that spits out a friendly error message if there is no query string. When I use any of the rules I posted earlier, I get that error message. So apparently entry.php is getting hit, but without a query string.
Not only that, but my page is displayed without the appropriate CSS (i.e. unstyled). I have no idea what's up with that.
Any clues?
Not only that, but my page is displayed without the appropriate CSS (i.e. unstyled). I have no idea what's up with that.
this is simple: if you refer to your stylesheet relatively, it won't work. you must refer it by the whole path: http://
flow:
<link rel=stylesheet href="myfile.css">
browser is looking in the folder for myfile.css, which is in the root directory.
as long as you call your file by
[example.com...]
it will work.
if you call the same file like this:
[example.com...]
the browser won't look for myfile.css in the root directory, but in /entry/john_doe/ , where it surely isn't, eh?
solution:
<link rel=stylesheet href="http://www.example.com/myfile.css">
good luck with the mod_rewrite! :)