Code: Select all
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^genre/(.+) genre.php?g=$1 [r=301,nc]Well, it's not working.. Any help would be great!
Moderator: General Moderators
Code: Select all
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^genre/(.+) genre.php?g=$1 [r=301,nc]Code: Select all
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^genre.php?g=(.+) dvds/genre/$1 [NC]It actually was right the first timeprogrammermatt wrote:You have it backwards, it is going to rewrite any request from 'domain.com/genre/whatever' to 'genre.php?g=whatever'
Code: Select all
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^/genre/(.+)$ genre.php?g=$1 [NC]Maybe one of the following is causing the issue:rsmarsha wrote:Just found this post. I am having rewrite problems too.
I found this in a tutorial:
RewriteEngine on
RewriteRule ^page/([^/\.]+)/?$ ad_index.php?page=$1
That should rewrite page/orders to index.php?page=orders
When i enter in
url/page/orders
i just get a 404 error.
Any ideas what i'm doing wrong?
I also tried
RewriteRule ^home\.php home2.php
to take home.php and redirect to home2.php and i get another 404 error.
Also found another tutorial at : http://www.sitepoint.com/article/guide-url-rewriting/2
so tried this :
RewriteRule index/([a-z]+) index.php?page=$1
so when i typed in url/index/orders the window should show me index.php?page=orders , and again i get the 404 error.
I've read a few tutorials and tried their basic rewrites, so i must be missing something.![]()
If anyone could help me figure out what i'm missing that would be great.
Just run phpinfo() and you should be able to see what's there.rsmarsha wrote:I was told it is, will check again.Can also test on my own server.
If i use one that changes
index.php?page=name
into
index/name
It seems to work, but it's not using the stylesheet and the images don't show correctly. Is this normal?
Code: Select all
RewriteEngine on
RewriteRule ^index/([a-z]+) index.php?page=$1 [L]When rewriting using clean URLs I have not found a better solution than to add a <base href="/base/path/"/> to the header. It makes images, ces and links all work properly. I started a thread about it here but have not found any better methods to deal with it.rsmarsha wrote:The one on my shared server does seem to work, but images and css still not working as they should when using the rewritten links.
This mod_rewrite thing is a bit confusing atm.
Code: Select all
<html>
<head>
<base href="{BASE}"/>
// or
<base href="<?php echo $config->base ?>"/>