Comments on: Fancy Flat URL’s with htaccess http://www.terminally-incoherent.com/blog/2009/08/25/fancy-flat-urls-with-htaccess/ I will not fix your computer. Tue, 04 Aug 2020 22:34:33 +0000 hourly 1 https://wordpress.org/?v=4.7.26 By: kakalot http://www.terminally-incoherent.com/blog/2009/08/25/fancy-flat-urls-with-htaccess/#comment-23850 Sat, 03 Nov 2012 05:21:16 +0000 http://www.terminally-incoherent.com/blog/?p=3687#comment-23850

I need to rewrite sub.domainname.com/rewrite-string/abc/def/ to sub.domainname.com/index.php/dir/controller/?var1=abc&var2=def.
When user enter sub.domainname.com/rewrite-string/abc/def/ , browser will redirect to sub.domainname.com/index.php/dir/controller/?var1=abc&var2=def. I found this article and try but I can’t do that. Please some body help me!

Reply  |  Quote
]]>
By: Jag http://www.terminally-incoherent.com/blog/2009/08/25/fancy-flat-urls-with-htaccess/#comment-18299 Wed, 19 Jan 2011 19:21:19 +0000 http://www.terminally-incoherent.com/blog/?p=3687#comment-18299

hey thanks im fighting with so many shitty websites appeared first on google but they didn’t work and this worked very well. anyway we can avoid (RewriteBase /foo/) this or make it general ?

Reply  |  Quote
]]>
By: Milos http://www.terminally-incoherent.com/blog/2009/08/25/fancy-flat-urls-with-htaccess/#comment-13069 Wed, 26 Aug 2009 19:36:16 +0000 http://www.terminally-incoherent.com/blog/?p=3687#comment-13069

A very useful suggestion. Enjoyed (and was surprised by) the brief post as well. :) Thanks!

Reply  |  Quote
]]>
By: Chris Wellons http://www.terminally-incoherent.com/blog/2009/08/25/fancy-flat-urls-with-htaccess/#comment-13060 Tue, 25 Aug 2009 19:08:52 +0000 http://www.terminally-incoherent.com/blog/?p=3687#comment-13060

Heh, I’ve got rewrite rules all over my server to clean things up. My main one has 8 entries at the moment. A lot of times when I see unnecessarily ugly URLs I wish people would do this more. Clean URLs are nice.

You have to be careful with relative addresses, though. If you used an image located at “/img/me.jpg”, with the src set relatively to “img/me.jpg”, and your document was at,


/blog.php?name=example&year=2009

and it moves to,


/blog/2009/example/

The browser will go looking for it at,


/blog/2009/example/img/me.jpg

which will return 404 or something. It gets more complicated if the same document can be reached from different levels in the hierarchy.

There are two solutions. The hackish way is to rewrite the stuff to not be as relative: put in the root slash. The more elegant solution is the base tag, which goes in the head.

Reply  |  Quote
]]>
By: freelancer http://www.terminally-incoherent.com/blog/2009/08/25/fancy-flat-urls-with-htaccess/#comment-13059 Tue, 25 Aug 2009 15:28:23 +0000 http://www.terminally-incoherent.com/blog/?p=3687#comment-13059

Nice tip. Just one addition for people who are not very familiar with .htaccess files; If you can place this in the Apache config instead (inside a Directory or DirectoryMatch section in httpd.conf, or another config file that’s included) you should. This is because if there is an .htaccess file, it is read every time a request is made, but if it’s in the config it’s only read once when the server is started.

Reply  |  Quote
]]>