I am facing this very annoying problem, and the solution doesn't seem to come to me.
I have made some RewriteRules in .htaccess for the urls.
So basically i am rewriting /something to index.php?page=something
RewriteRule ^([a-zA-Zа-яА-Я0-9-]+)/?$ index.php?page=$1
I have made second rule to use for pages that are dynamically generated, so i have:
RewriteRule ^page/([a-zA-Zа-яА-Я0-9-]+)/?$ index.php?page=webpage&page_url=$1
Everything works fine, until the moment that i follow one of the /page/ links, then, all links become /page/page/something ....
Also i have /category/something that goes to indes.php?page=category&category_url=someging
When i am in /page/something those links become /page/category/something ...
I am sure that there is some very easy way to escape that problem, but I cannot find it ...
This is my whole .htaccess file:
RewriteEngine On
RewriteRule ^(admin|img)($|/) - [L]
RewriteBase /auto-remote
RewriteRule ^index.php$ - [L]
RewriteRule ^([a-zA-Zа-яА-Я0-9-]+)/?$ index.php?page=$1
RewriteRule ^page/([a-zA-Zа-яА-Я0-9-]+)/?$ index.php?page=webpage&page_url=$1
RewriteRule ^category/([a-zA-Zа-яА-Я0-9-]+)/?$ index.php?page=category&category_url=$1
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -l
RewriteRule ^.*$ - [L,QSA]
RewriteRule ^.*includes/(.*)$ includes/$1 [L]
RewriteRule ^.*media/(.*)$ media/$1 [L]
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…