Directory-level configuration file used by Apache web servers.

learn more… | top users | synonyms

5
votes
0answers
36 views

An .htaccess for our entire site

We have this long .htaccess mainly rewriting our URLs. Everything works fine (except blog titles containing a ' , but we're working on that) but I'm sure it can be ...
0
votes
2answers
38 views

All-purposes AJAX handler made with PHP and .htaccess that speaks JSON

In a project I've started, I decided to implement some new code to handle AJAX requests. The requirements are that it can ONLY access the /ajax/ folder, load ...
1
vote
2answers
33 views

Redirecting all pages under a certain directory to a single file

I want to redirect all pages under a certain directory to a single file, like so: /dir/a/dir/new ...
3
votes
1answer
30 views

Faults using mod_rewrite

I never really bothered using mod_rewrite to achieve SEO friendly names but I've always admired from a distance because I've never been good at regex. The below .htaccess file does work, but I'm ...
4
votes
0answers
75 views

.htaccess index.php removal, static content serving

I am writing a CMS type application and I am trying to restrict how the server gets accessed. Any content (in js/, css/ or images/ directories) should be served as is, as long as there is an ...
2
votes
1answer
36 views

Forcing SSL and WWW using .htaccess

I would like to know if this code in .htaccess for forcing SSL and WWW in URL is correct, because with another code I usually get redirect loop, e.g. ...
3
votes
1answer
127 views

htaccess for URL remapping, caching, and compression

I have been collecting snippets from all over the place and then put them all together creating the following .htaccess file. I really don't understand if what I have done below is good/should work ...
12
votes
1answer
284 views

Portable website template

I have spent the last 6 months as I am studying web development in college to build a website template that is responsive and accessible from as many devices and browsers as possible. I would really ...
4
votes
1answer
111 views

Review URL-prettifying .htaccess file

Can anyone please review the following .htaccess file and let me if it is correctly put together? What I think it does: So it direct to a custom 404 page Remove ...
1
vote
0answers
808 views

Automatically redirect /index.php files to their URL directory with .htaccess

The requirements: Work inside .htaccess (preferably via mod_rewrite) Redirect requests from /any/directory/index.php to ...
2
votes
2answers
452 views

Is it ok to use PHP's strpos and substr altogether in one statement?

I am using PHP to build a REST API. I want to receive requests from the URL in the following format: http://mydomain.com/api/format/method?app_id=value&call=encrypted_request So, I have modified ...
2
votes
1answer
104 views

Can my router code be improved?

I have created a nice url structure for my site. In my .htaccess I have: FallBackResource /index.php And in my router class I have: ...
6
votes
1answer
212 views

Canonicalize URLs for static website

I want to "canonicalize" URLs for my static (files and folders) website. The 'Aims' describes what I want to accomplish. The 'Code' gives my current .htaccess. ...
5
votes
1answer
172 views

Suggestions on how to improve this .htaccess file for page load speed

Here is my standard .htaccess file, any suggestions on how I can improve it with regards to page load speed? Would gZip instead of DEFLATE make any sort of difference? ...
6
votes
2answers
4k views

MVC router class

Below is what I have come up with for a router/dispatcher system for my personal framework I am working on. Can you please review and tell me any improvements that could be made? The first part is ...