0
I have a link like this:
<a href="index/pagina=$i"> $i </a>
wanted the URL to look like this:
index/2
and I’m using the .htaccess
thus:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^index?$ index.php [NC,L]
RewriteRule ^index/([a-z0-9-]+)/?$ index.php?pagina=$1 [NC]
</IfModule>
Where is the problem?
It redirects but the css comes back all broken
– Lourençon O.
@Brendollourençon Add
<base href="http://[SEU SITE]/" />
in thehead
from your page and see if it solves your problem.– André Ribeiro
in the <base href="http://localhost case/" /> ?
– Lourençon O.
Man I don’t know how to thank you, it worked out here Andre Brook thank you so much !
– Lourençon O.
about "broken css", just add two exceptions in htaccess. This prevents you from applying the rules to existing files physically Rewritecond %{SCRIPT_FILENAME} ! -f This other for directories: Rewritecond %{SCRIPT_FILENAME} ! -d Hence you don’t even need to use the <base tag>
– Daniel Omine
I will post separately because there is no line break in the comments
– Daniel Omine
with the <base href="http://[YOUR SITE]/" /> worked, I did not know this tag, got it right, thanks ai galera !
– Lourençon O.
Rewritecond %{SCRIPT_FILENAME} ! -f
– Daniel Omine
Rewritecond %{SCRIPT_FILENAME} ! -d
– Daniel Omine