Rewritten urls without extension
2 posts
• Page 1 of 1
- martinshoe
-
- Posts: 2
- Joined: 04 Oct 2013, 02:31
Rewritten urls without extension
hi
I am using this code to rewrite my urls:
RewriteRule ^/([^/]+)/([^/]+)\.htm$ /index.asp?subpage=$2&mainpage=$1
www.mysite.com/index.asp?subpage=wine&mainpage=drinks
www.mysite.com/drinks/wine.htm
This works fine, but now i want to get rid of the .htm extension
For example: www.mysite.com/drinks/wine
I tried to modify the RewriteRule, but it does not work of i change it to:
RewriteRule ^/([^/]+)/([^/]+)$ /index.asp?subpage=$2&mainpage=$1
Css and js are not loaded
What am i doing wrong?
Thanks Martin
I am using this code to rewrite my urls:
RewriteRule ^/([^/]+)/([^/]+)\.htm$ /index.asp?subpage=$2&mainpage=$1
www.mysite.com/index.asp?subpage=wine&mainpage=drinks
www.mysite.com/drinks/wine.htm
This works fine, but now i want to get rid of the .htm extension
For example: www.mysite.com/drinks/wine
I tried to modify the RewriteRule, but it does not work of i change it to:
RewriteRule ^/([^/]+)/([^/]+)$ /index.asp?subpage=$2&mainpage=$1
Css and js are not loaded
What am i doing wrong?
Thanks Martin
Re: Rewritten urls without extension
Hello, Martin
"Css and js are not loaded"
- this usually happens when paths to css and js resources are relative.
Please consider using root-relative or absolute paths and the issue will disappear.
In your new pattern the folder structure is different: /drinks/wine is 2 levels of folders while drinks/wine.htm is just one.
"Css and js are not loaded"
- this usually happens when paths to css and js resources are relative.
Please consider using root-relative or absolute paths and the issue will disappear.
In your new pattern the folder structure is different: /drinks/wine is 2 levels of folders while drinks/wine.htm is just one.
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 17 guests